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

/* Variables and functions */
int /*<<< orphan*/ wq_list_cut(struct io_wq_work_list *,
                               struct io_wq_work_node *,
                               struct io_wq_work_node *);
void wq_list_del(struct io_wq_work_list *list, struct io_wq_work_node *node,
                 struct io_wq_work_node *prev) {
  wq_list_cut(list, node, prev);
}


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

x86 assembly (clang, -O2):
<wq_list_del>:
jmp    1030 <wq_list_cut@plt>

LLVM IR (-O0):
%struct.io_wq_work_list = type { i32 }
%struct.io_wq_work_node = type { i32 }
define void @wq_list_del(%struct.io_wq_work_list* %0, %struct.io_wq_work_node* %1, %struct.io_wq_work_node* %2) {
%4 = alloca %struct.io_wq_work_list*
%5 = alloca %struct.io_wq_work_node*
%6 = alloca %struct.io_wq_work_node*
store %struct.io_wq_work_list* %0, %struct.io_wq_work_list** %4
store %struct.io_wq_work_node* %1, %struct.io_wq_work_node** %5
store %struct.io_wq_work_node* %2, %struct.io_wq_work_node** %6
%7 = load %struct.io_wq_work_list*, %struct.io_wq_work_list** %4
%8 = load %struct.io_wq_work_node*, %struct.io_wq_work_node** %5
%9 = load %struct.io_wq_work_node*, %struct.io_wq_work_node** %6
%10 = call i32 @wq_list_cut(%struct.io_wq_work_list* %7, %struct.io_wq_work_node* %8, %struct.io_wq_work_node* %9)
ret void
}

LLVM IR (-O2):
%struct.io_wq_work_list = type { i32 }
%struct.io_wq_work_node = type { i32 }
define void @wq_list_del(%struct.io_wq_work_list* %0, %struct.io_wq_work_node* %1, %struct.io_wq_work_node* %2) {
%4 = tail call i32 @wq_list_cut(%struct.io_wq_work_list* %0, %struct.io_wq_work_node* %1, %struct.io_wq_work_node* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ungetc(int c, FILE *stream __attribute__((unused))) { return 0; }


x86 assembly (clang, -O0):
<ungetc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ungetc(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("The value of EOF is %i\n", EOF); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"The value of EOF is %i\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The value of EOF is %i\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
unsigned long binomial_Coeff(int, unsigned int);
unsigned long int catalan(unsigned int n) {
  unsigned long int c = binomial_Coeff(2 * n, n);
  return c / (n + 1);
}


x86 assembly (clang, -O0):
<catalan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
mov    -0x4(%rbp),%esi
call   1030 <binomial_Coeff@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
xor    %edx,%edx
div    %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catalan>:
push   %rbx
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%edi
mov    %ebx,%esi
call   1030 <binomial_Coeff@plt>
add    $0x1,%ebx
mov    %rax,%rcx
shr    $0x20,%rcx
je     1130 <catalan+0x20>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @catalan(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 2, %4
%6 = load i32, i32* %2
%7 = call i64 @binomial_Coeff(i32 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = add i32 %9, 1
%11 = zext i32 %10 to i64
%12 = udiv i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @catalan(i32 %0) {
%2 = shl i32 %0, 1
%3 = tail call i64 @binomial_Coeff(i32 %2, i32 %0)
%4 = add i32 %0, 1
%5 = zext i32 %4 to i64
%6 = udiv i64 %3, %5
ret i64 %6
}
int ntlibc_strlen(const char *s) {
  const char *p = s;
  int cnt = 0;
  while (*p) {
    cnt++;
    p++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<ntlibc_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <ntlibc_strlen+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <ntlibc_strlen+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_strlen>:
cmpb   $0x0,(%rdi)
je     111c <ntlibc_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ntlibc_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ntlibc_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int ptr_equal(void *i1, void *i2) { return ((int)(i1 == i2)); }


x86 assembly (clang, -O0):
<ptr_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @ptr_equal(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ptr_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int param_set_charp(const char *val, struct kernel_param *kp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_set_charp(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ftello(int /*<<< orphan*/ *);
int64_t ftell_x(FILE *fp) { return ftello(fp); }


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

x86 assembly (clang, -O2):
<ftell_x>:
jmp    1030 <ftello@plt>

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

LLVM IR (-O2):
define i32 @ftell_x(i32* nocapture %0) {
%2 = tail call i32 @ftello(i32* %0)
ret i32 %2
}
/* Variables and functions */
int scanw(char *, int *);
int i_scanw(char *fmt, int *i) { return (scanw(fmt, i)); }


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

x86 assembly (clang, -O2):
<i_scanw>:
jmp    1030 <scanw@plt>

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

LLVM IR (-O2):
define i32 @i_scanw(i8* %0, i32* %1) {
%3 = tail call i32 @scanw(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void dynlolib_FreeLibrary(void *pLibrary) {
  dlclose(pLibrary);
  return;
}


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

x86 assembly (clang, -O2):
<dynlolib_FreeLibrary>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @dynlolib_FreeLibrary(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
const char *usbfs_dir_find(void) {
  static char udev_usb_path[] = "/dev/bus/usb";
  if (access(udev_usb_path, F_OK) == 0)
    return udev_usb_path;
  return NULL;
}


x86 assembly (clang, -O0):
<usbfs_dir_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1147 <usbfs_dir_find+0x37>
lea    0x2eea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <usbfs_dir_find+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usbfs_dir_find>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x2f07(%rip),%rbx
mov    %rbx,%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@usbfs_dir_find.udev_usb_path = internal global [13 x i8] c"/dev/bus/usb\00"
@F_OK = global i32 0
define i8* @usbfs_dir_find() {
%1 = alloca i8*
%2 = load i32, i32* @F_OK
%3 = call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usbfs_dir_find.udev_usb_path, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usbfs_dir_find.udev_usb_path, i64 0, i64 0), i8** %1
br label %7
6: ; preds = %0
store i8* null, i8** %1
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@usbfs_dir_find.udev_usb_path = internal global [13 x i8] c"/dev/bus/usb\00"
@F_OK = global i32 0
define i8* @usbfs_dir_find() {
%1 = load i32, i32* @F_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usbfs_dir_find.udev_usb_path, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usbfs_dir_find.udev_usb_path, i64 0, i64 0), i8* null
ret i8* %4
}
/* Variables and functions */
scalar_t__ malloc(int);
void function_with_leak1() { char *x = (char *)malloc(12); }


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

x86 assembly (clang, -O2):
<function_with_leak1>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @function_with_leak1() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 12)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @function_with_leak1() {
%1 = tail call i64 @malloc(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputDAchannel(int, int /*<<< orphan*/);
void ClearAllDA(void) {
  int channel_no;
  for (channel_no = 1; channel_no <= 4; channel_no++)
    OutputDAchannel(channel_no, 0);
}


x86 assembly (clang, -O0):
<ClearAllDA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jg     1141 <ClearAllDA+0x31>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <OutputDAchannel@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ClearAllDA+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearAllDA>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x4,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <OutputDAchannel@plt>

LLVM IR (-O0):
define void @ClearAllDA() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 4
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @OutputDAchannel(i32 %6, i32 0)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ClearAllDA() {
%1 = tail call i32 @OutputDAchannel(i32 1, i32 0)
%2 = tail call i32 @OutputDAchannel(i32 2, i32 0)
%3 = tail call i32 @OutputDAchannel(i32 3, i32 0)
%4 = tail call i32 @OutputDAchannel(i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void client_path(char *path, char *hostname, char *filename) {
  sprintf(path, "./clients/%s/%s", hostname, filename);
}


x86 assembly (clang, -O0):
<client_path>:
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),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_path>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"./clients/%s/%s\00"
define void @client_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"./clients/%s/%s\00"
define void @client_path(i8* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
int add2(int n, int m) { return n + m; }


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void indent_puts(str) char str[];
{
  do_indent();
  outn(str);
}


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

x86 assembly (clang, -O2):
<indent_puts>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <do_indent@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outn@plt>

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

LLVM IR (-O2):
define void @indent_puts(i8* %0) {
%2 = tail call i32 (...) @do_indent()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outn to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncat(int /*<<< orphan*/, char *, int);
void strncat_null_dst(char *x) { strncat(0, x, 4); }


x86 assembly (clang, -O0):
<strncat_null_dst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <strncat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_null_dst>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x4,%edx
jmp    1030 <strncat@plt>

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

LLVM IR (-O2):
define void @strncat_null_dst(i8* %0) {
%2 = tail call i32 @strncat(i32 0, i8* %0, i32 4)
ret void
}
int edge_coord(int y, int x1, int y1, int x2, int y2) {
  if (x2 > x1)
    return x2 + (y - y2) * (x2 - x1) / (y2 - y1);
  else
    return x1 + (y - y1) * (x2 - x1) / (y2 - y1);
}


x86 assembly (clang, -O0):
<edge_coord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114d <edge_coord+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <edge_coord+0x75>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edge_coord>:
mov    %edi,%r9d
sub    %edx,%r9d
sub    %r8d,%edi
mov    %ecx,%eax
sub    %esi,%eax
cmovg  %eax,%r9d
cmovg  %edi,%eax
cmovg  %ecx,%esi
imul   %r9d,%eax
sub    %edx,%r8d
cltd
idiv   %r8d
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @edge_coord(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
%11 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %10
%13 = load i32, i32* %8
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %29
15: ; preds = %5
%16 = load i32, i32* %10
%17 = load i32, i32* %7
%18 = load i32, i32* %11
%19 = sub nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %8
%22 = sub nsw i32 %20, %21
%23 = mul nsw i32 %19, %22
%24 = load i32, i32* %11
%25 = load i32, i32* %9
%26 = sub nsw i32 %24, %25
%27 = sdiv i32 %23, %26
%28 = add nsw i32 %16, %27
store i32 %28, i32* %6
br label %43
29: ; preds = %5
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = load i32, i32* %9
%33 = sub nsw i32 %31, %32
%34 = load i32, i32* %10
%35 = load i32, i32* %8
%36 = sub nsw i32 %34, %35
%37 = mul nsw i32 %33, %36
%38 = load i32, i32* %11
%39 = load i32, i32* %9
%40 = sub nsw i32 %38, %39
%41 = sdiv i32 %37, %40
%42 = add nsw i32 %30, %41
store i32 %42, i32* %6
br label %43
43: ; preds = %29, %15
%44 = load i32, i32* %6
ret i32 %44
}

LLVM IR (-O2):
define i32 @edge_coord(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %3, %1
%7 = sub nsw i32 %0, %2
%8 = sub nsw i32 %3, %1
%9 = sub nsw i32 %0, %4
%10 = sub nsw i32 %3, %1
%11 = select i1 %6, i32 %10, i32 %7
%12 = select i1 %6, i32 %9, i32 %8
%13 = select i1 %6, i32 %3, i32 %1
%14 = mul nsw i32 %12, %11
%15 = sub nsw i32 %4, %2
%16 = sdiv i32 %14, %15
%17 = add nsw i32 %16, %13
ret i32 %17
}
/* Variables and functions */
size_t reverse(size_t);
bool ispalin(size_t num) {
  if (reverse(num) == num)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ispalin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
cmp    -0x10(%rbp),%rax
jne    113b <ispalin+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ispalin+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispalin>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reverse@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispalin(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @reverse(i64 %4)
%6 = load i64, i64* %3
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @ispalin(i64 %0) {
%2 = tail call i64 @reverse(i64 %0)
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void pci_restore_dpc_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_dpc_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_seed(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<get_seed>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_seed() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_seed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_number_of_multprec_solutions(int *length) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc(452, a, length, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_number_of_multprec_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c4,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_number_of_multprec_solutions>:
mov    %rdi,%rdx
mov    $0x1c4,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_number_of_multprec_solutions(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 452, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_number_of_multprec_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 452, i32* undef, i32* %0, double* undef)
ret i32 %2
}
/* Variables and functions */
unsigned int _hrt_align_down(unsigned int, unsigned int);
unsigned int _hrt_align_up(unsigned int a, unsigned int b) {
  return _hrt_align_down(a + b - 1, b);
}


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

x86 assembly (clang, -O2):
<_hrt_align_up>:
add    %esi,%edi
add    $0xffffffff,%edi
jmp    1030 <_hrt_align_down@plt>

LLVM IR (-O0):
define i32 @_hrt_align_up(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = call i32 @_hrt_align_down(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @_hrt_align_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = tail call i32 @_hrt_align_down(i32 %4, i32 %1)
ret i32 %5
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_menu_status(const struct cec_msg *msg, __u8 *menu_state) {
  *menu_state = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_menu_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_menu_status(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_menu_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
void skipComment(FILE *file) {
  while (!feof(file)) {
    char c;
    c = fgetc(file);
    if (c == '\n') {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<skipComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <skipComment+0x2a>
jmp    116d <skipComment+0x4d>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1168 <skipComment+0x48>
jmp    116d <skipComment+0x4d>
jmp    112c <skipComment+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipComment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
jne    1148 <skipComment+0x28>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1130 <skipComment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skipComment(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = load i32*, i32** %2
%6 = call i32 @feof(i32* %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = load i32*, i32** %2
%11 = call signext i8 @fgetc(i32* %10)
store i8 %11, i8* %3
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %9
br label %17
16: ; preds = %9
br label %4
17: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
define void @skipComment(i32* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %2
8: ; preds = %5, %2
ret void
}
int physeql(void *x, void *y) { return (x == y); }


x86 assembly (clang, -O0):
<physeql>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<physeql>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @physeql(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @physeql(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int GetIndividual(int x, int y, int *Array) { return (Array[x + (10000 * y)]); }


x86 assembly (clang, -O0):
<GetIndividual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   $0x2710,-0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetIndividual>:
imul   $0x2710,%esi,%eax
add    %edi,%eax
cltq
mov    (%rdx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @GetIndividual(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* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 10000, %9
%11 = add nsw i32 %8, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %7, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @GetIndividual(i32 %0, i32 %1, i32* nocapture %2) {
%4 = mul nsw i32 %1, 10000
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %2, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
double gamma(double);
double gamma_(double *x) { return gamma(*x); }


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

x86 assembly (clang, -O2):
<gamma_>:
movsd  (%rdi),%xmm0
jmp    1030 <gamma@plt>

LLVM IR (-O0):
define double @gamma_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @gamma(double %4)
ret double %5
}

LLVM IR (-O2):
define double @gamma_(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @gamma(double %2)
ret double %3
}
void gtk_tree_model_iter_nth_child() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_iter_nth_child() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print0(int);
int /*<<< orphan*/ sem_add(int, int);
int /*<<< orphan*/ sem_sub(int, int);
int semid_init(int *);
void parent() {
  int semid;
  int ret;
  ret = semid_init(&semid);
  if (ret < 0) {
    exit(-1);
  }
  sem_add(semid, 1);
  while (1) {
    sem_sub(semid, 1);
    print0(100);
    sem_add(semid, 1);
  }
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <semid_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1178 <parent+0x28>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <sem_add@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1070 <sem_sub@plt>
mov    $0x64,%edi
call   1060 <print0@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <sem_add@plt>
jmp    1185 <parent+0x35>

x86 assembly (clang, -O2):
<parent>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <semid_init@plt>
test   %eax,%eax
js     1198 <parent+0x48>
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1040 <sem_add@plt>
nopl   (%rax)
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1070 <sem_sub@plt>
mov    $0x64,%edi
call   1060 <print0@plt>
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1040 <sem_add@plt>
jmp    1170 <parent+0x20>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @parent() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @semid_init(i32* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i32 @sem_add(i32 %9, i32 1)
br label %11
11: ; preds = %8, %11
%12 = load i32, i32* %1
%13 = call i32 @sem_sub(i32 %12, i32 1)
%14 = call i32 @print0(i32 100)
%15 = load i32, i32* %1
%16 = call i32 @sem_add(i32 %15, i32 1)
br label %11
}

LLVM IR (-O2):
define void @parent() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @semid_init(i32* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @sem_add(i32 %8, i32 1)
br label %10
10: ; preds = %10, %7
%11 = load i32, i32* %1
%12 = call i32 @sem_sub(i32 %11, i32 1)
%13 = call i32 @print0(i32 100)
%14 = load i32, i32* %1
%15 = call i32 @sem_add(i32 %14, i32 1)
br label %10
}
/* Variables and functions */
int /*<<< orphan*/ implicitUnsignedTruncation(unsigned int);
int main(int argc, char **argv) { return !implicitUnsignedTruncation(~0U); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <implicitUnsignedTruncation@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <implicitUnsignedTruncation@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @implicitUnsignedTruncation(i32 -1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void AUXADCGenManualTrigger(void) {
  (*((volatile unsigned long *)(0x400C9000 + 0x0000001C))) = 0;
}


x86 assembly (clang, -O0):
<AUXADCGenManualTrigger>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400c901c,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXADCGenManualTrigger>:
movq   $0x0,0x400c901c
ret

LLVM IR (-O0):
define void @AUXADCGenManualTrigger() {
store volatile i64 0, i64* inttoptr (i64 1074565148 to i64*)
ret void
}

LLVM IR (-O2):
define void @AUXADCGenManualTrigger() {
store volatile i64 0, i64* inttoptr (i64 1074565148 to i64*)
ret void
}
int h(const void *key) {
  int ir;
  unsigned int *i = (unsigned int *)key;
  ir = *i % 100;
  return ir;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    (%rdi),%eax
imul   $0x51eb851f,%rax,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @h(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = urem i32 %8, 100
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @h(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = urem i32 %3, 100
ret i32 %4
}
/* Type definitions */
struct flock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fcntl(int /*<<< orphan*/, int, int);
void test_argument_with_type_tag(struct flock *f) {
  fcntl(0, 10, 10);
  fcntl(0, 20, f);
  fcntl(0, 20, 10);
  fcntl(0, 10, f);
}


x86 assembly (clang, -O0):
<test_argument_with_type_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0xa,%edx
mov    %edx,%esi
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edx
xor    %edi,%edi
mov    $0x14,%esi
call   1030 <fcntl@plt>
xor    %edi,%edi
mov    $0x14,%esi
mov    $0xa,%edx
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edx
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_argument_with_type_tag>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0xa,%esi
mov    $0xa,%edx
call   1030 <fcntl@plt>
xor    %edi,%edi
mov    $0x14,%esi
mov    %ebx,%edx
call   1030 <fcntl@plt>
xor    %edi,%edi
mov    $0x14,%esi
mov    $0xa,%edx
call   1030 <fcntl@plt>
xor    %edi,%edi
mov    $0xa,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
%struct.flock = type { i32 }
define void @test_argument_with_type_tag(%struct.flock* %0) {
%2 = alloca %struct.flock*
store %struct.flock* %0, %struct.flock** %2
%3 = call i32 @fcntl(i32 0, i32 10, i32 10)
%4 = load %struct.flock*, %struct.flock** %2
%5 = ptrtoint %struct.flock* %4 to i32
%6 = call i32 @fcntl(i32 0, i32 20, i32 %5)
%7 = call i32 @fcntl(i32 0, i32 20, i32 10)
%8 = load %struct.flock*, %struct.flock** %2
%9 = ptrtoint %struct.flock* %8 to i32
%10 = call i32 @fcntl(i32 0, i32 10, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.flock = type { i32 }
define void @test_argument_with_type_tag(%struct.flock* %0) {
%2 = tail call i32 @fcntl(i32 0, i32 10, i32 10)
%3 = ptrtoint %struct.flock* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @fcntl(i32 0, i32 20, i32 %4)
%6 = tail call i32 @fcntl(i32 0, i32 20, i32 10)
%7 = tail call i32 @fcntl(i32 0, i32 10, i32 %4)
ret void
}
/* Variables and functions */
int libtu_do_setparam(int /*<<< orphan*/, int);
int /*<<< orphan*/ libtu_string_to_setparam(char const *);
int libtu_do_setparam_str(const char *str, int val) {
  return libtu_do_setparam(libtu_string_to_setparam(str), val);
}


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

x86 assembly (clang, -O2):
<libtu_do_setparam_str>:
push   %rbx
mov    %esi,%ebx
call   1040 <libtu_string_to_setparam@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <libtu_do_setparam@plt>

LLVM IR (-O0):
define i32 @libtu_do_setparam_str(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 @libtu_string_to_setparam(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @libtu_do_setparam(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @libtu_do_setparam_str(i8* %0, i32 %1) {
%3 = tail call i32 @libtu_string_to_setparam(i8* %0)
%4 = tail call i32 @libtu_do_setparam(i32 %3, i32 %1)
ret i32 %4
}
unsigned short rfc1035Qid(void) {
  static unsigned short qid = 0x0001;
  if (++qid == 0xFFFF)
    qid = 0x0001;
  return qid;
}


x86 assembly (clang, -O0):
<rfc1035Qid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%ax
add    $0x1,%ax
mov    %ax,0x2f0a(%rip)
movzwl %ax,%eax
cmp    $0xffff,%eax
jne    112d <rfc1035Qid+0x2d>
movw   $0x1,0x2ef3(%rip)
movzwl 0x2eec(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc1035Qid>:
movzwl 0x2f19(%rip),%ecx
add    $0x1,%ecx
cmp    $0xffff,%cx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %ax,0x2f03(%rip)
ret

LLVM IR (-O0):
@rfc1035Qid.qid = internal global i16 1
define zeroext i16 @rfc1035Qid() {
%1 = load i16, i16* @rfc1035Qid.qid
%2 = add i16 %1, 1
store i16 %2, i16* @rfc1035Qid.qid
%3 = zext i16 %2 to i32
%4 = icmp eq i32 %3, 65535
br i1 %4, label %5, label %6
5: ; preds = %0
store i16 1, i16* @rfc1035Qid.qid
br label %6
6: ; preds = %5, %0
%7 = load i16, i16* @rfc1035Qid.qid
ret i16 %7
}

LLVM IR (-O2):
@rfc1035Qid.qid = internal unnamed_addr global i16 1
define zeroext i16 @rfc1035Qid() {
%1 = load i16, i16* @rfc1035Qid.qid
%2 = add i16 %1, 1
%3 = icmp eq i16 %2, -1
%4 = select i1 %3, i16 1, i16 %2
store i16 %4, i16* @rfc1035Qid.qid
ret i16 %4
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructPPForm(void *, struct constructHeader *);
const char *EnvGetDefclassPPForm(void *theEnv, void *theClass) {
  return GetConstructPPForm(theEnv, (struct constructHeader *)theClass);
}


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

x86 assembly (clang, -O2):
<EnvGetDefclassPPForm>:
jmp    1030 <GetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefclassPPForm(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 = bitcast i8* %6 to %struct.constructHeader*
%8 = call i8* @GetConstructPPForm(i8* %5, %struct.constructHeader* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefclassPPForm(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructPPForm(i8* %0, %struct.constructHeader* %3)
ret i8* %4
}
int **(wcheck_int_ptr_ptr)(int **to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define i32** @wcheck_int_ptr_ptr(i32** readnone returned %0) {
ret i32** %0
}
/* Variables and functions */
int /*<<< orphan*/ initcryptofunctions();
int /*<<< orphan*/ parseargs(int, char **);
int main(int argc, char **argv) {
  initcryptofunctions();
  parseargs(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <initcryptofunctions@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parseargs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <initcryptofunctions@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <parseargs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @initcryptofunctions()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parseargs(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @initcryptofunctions()
%4 = tail call i32 @parseargs(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
float sinf(float);
float nvg__sinf(float a) { return sinf(a); }


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

x86 assembly (clang, -O2):
<nvg__sinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @nvg__sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}