xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fill_array(int, int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ print_array(int, int *);
int /*<<< orphan*/ sort_array(int, int *);
int main() {
  int *input_array;
  int array_size = 10;
  input_array = malloc(array_size * sizeof(int));
  fill_array(array_size, input_array);
  print_array(array_size, input_array);
  sort_array(array_size, input_array);
  print_array(array_size, input_array);
  free(input_array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <fill_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <sort_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1070 <fill_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <sort_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %2
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = call i32 @fill_array(i32 %9, i32* %10)
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
%14 = call i32 @print_array(i32 %12, i32* %13)
%15 = load i32, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @sort_array(i32 %15, i32* %16)
%18 = load i32, i32* %3
%19 = load i32*, i32** %2
%20 = call i32 @print_array(i32 %18, i32* %19)
%21 = load i32*, i32** %2
%22 = call i32 @free(i32* %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @fill_array(i32 10, i32* %1)
%3 = tail call i32 @print_array(i32 10, i32* %1)
%4 = tail call i32 @sort_array(i32 10, i32* %1)
%5 = tail call i32 @print_array(i32 10, i32* %1)
%6 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
short SHRT_MIN;
int expect_short_sum(short (*f)(short a, short b)) {
  return f(SHRT_MIN + 1, -1) == SHRT_MIN;
}


x86 assembly (clang, -O0):
<expect_short_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec9(%rip),%rcx
movswl (%rcx),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%esi
movswl %cx,%edi
call   *%rax
cwtl
mov    0x2eb1(%rip),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_short_sum>:
push   %rbx
mov    %rdi,%rax
mov    0x2ed5(%rip),%rbx
movzwl (%rbx),%ecx
add    $0x1,%ecx
movswl %cx,%edi
mov    $0xffffffff,%esi
call   *%rax
xor    %ecx,%ecx
cmp    (%rbx),%ax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SHRT_MIN = global i16 0
define i32 @expect_short_sum(i16 (i16, i16)* %0) {
%2 = alloca i16 (i16, i16)*
store i16 (i16, i16)* %0, i16 (i16, i16)** %2
%3 = load i16 (i16, i16)*, i16 (i16, i16)** %2
%4 = load i16, i16* @SHRT_MIN
%5 = sext i16 %4 to i32
%6 = add nsw i32 %5, 1
%7 = trunc i32 %6 to i16
%8 = call signext i16 %3(i16 signext %7, i16 signext -1)
%9 = sext i16 %8 to i32
%10 = load i16, i16* @SHRT_MIN
%11 = sext i16 %10 to i32
%12 = icmp eq i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@SHRT_MIN = global i16 0
define i32 @expect_short_sum(i16 (i16, i16)* nocapture %0) {
%2 = load i16, i16* @SHRT_MIN
%3 = add i16 %2, 1
%4 = tail call signext i16 %0(i16 signext %3, i16 signext -1)
%5 = load i16, i16* @SHRT_MIN
%6 = icmp eq i16 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct fiemap_extent {
  int dummy;
};
struct fiemap {
  int dummy;
};

/* Variables and functions */
size_t fiemap_count_to_size(size_t extent_count) {
  return sizeof(struct fiemap) + extent_count * sizeof(struct fiemap_extent);
}


x86 assembly (clang, -O0):
<fiemap_count_to_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiemap_count_to_size>:
lea    0x4(,%rdi,4),%rax
ret

LLVM IR (-O0):
define i64 @fiemap_count_to_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4
%5 = add i64 4, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @fiemap_count_to_size(i64 %0) {
%2 = shl i64 %0, 2
%3 = add i64 %2, 4
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void finishinittab(void) { nocall("finishinittab"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"finishinittab\00"
define void @finishinittab() {
%1 = call i32 @nocall(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"finishinittab\00"
define void @finishinittab() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
GiveUsage() {
  fprintf(stdout, "MKCMD Version 1.8 (April 22, 1988)\n");
  fprintf(stdout, "Usage: MKCMD [-D<variable>] [-S<dlg dir>] file ...\n");
}


x86 assembly (clang, -O0):
<GiveUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GiveUsage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [36 x i8] c"MKCMD Version 1.8 (April 22, 1988)\0A\00"
@.str.1 = [52 x i8] c"Usage: MKCMD [-D<variable>] [-S<dlg dir>] file ...\0A\00"
define i32 @GiveUsage() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [36 x i8] c"MKCMD Version 1.8 (April 22, 1988)\0A\00"
@.str.1 = [52 x i8] c"Usage: MKCMD [-D<variable>] [-S<dlg dir>] file ...\0A\00"
define i32 @GiveUsage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _dwt_enableclocks(int);
int /*<<< orphan*/ deca_port_sleep(int);
int /*<<< orphan*/ dwt_write16bitoffsetreg(int, int, int);
void _dwt_loaducodefromrom(void) {
  _dwt_enableclocks(14);
  dwt_write16bitoffsetreg(0x2D, 0x06, 0x8000);
  deca_port_sleep(1);
  _dwt_enableclocks(1);
}


x86 assembly (clang, -O0):
<_dwt_loaducodefromrom>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <_dwt_enableclocks@plt>
mov    $0x2d,%edi
mov    $0x6,%esi
mov    $0x8000,%edx
call   1050 <dwt_write16bitoffsetreg@plt>
mov    $0x1,%edi
call   1040 <deca_port_sleep@plt>
mov    $0x1,%edi
call   1030 <_dwt_enableclocks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dwt_loaducodefromrom>:
push   %rax
mov    $0xe,%edi
call   1030 <_dwt_enableclocks@plt>
mov    $0x2d,%edi
mov    $0x6,%esi
mov    $0x8000,%edx
call   1050 <dwt_write16bitoffsetreg@plt>
mov    $0x1,%edi
call   1040 <deca_port_sleep@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <_dwt_enableclocks@plt>

LLVM IR (-O0):
define void @_dwt_loaducodefromrom() {
%1 = call i32 @_dwt_enableclocks(i32 14)
%2 = call i32 @dwt_write16bitoffsetreg(i32 45, i32 6, i32 32768)
%3 = call i32 @deca_port_sleep(i32 1)
%4 = call i32 @_dwt_enableclocks(i32 1)
ret void
}

LLVM IR (-O2):
define void @_dwt_loaducodefromrom() {
%1 = tail call i32 @_dwt_enableclocks(i32 14)
%2 = tail call i32 @dwt_write16bitoffsetreg(i32 45, i32 6, i32 32768)
%3 = tail call i32 @deca_port_sleep(i32 1)
%4 = tail call i32 @_dwt_enableclocks(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ send_command_to_variable_server(int, char *);
int set_binary(int socket) {
  if (send_command_to_variable_server(socket, "trick.var_binary()") < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<set_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
cmp    $0x0,%rax
jge    1140 <set_binary+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <set_binary+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_binary>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"trick.var_binary()\00"
define i32 @set_binary(i32 %0) {
%2 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
int getnbsize(int n) {
  int size;
  int i;
  size = 0;
  i = 1;
  while (n >= i) {
    i = i * 10;
    size++;
  }
  return (size);
}


x86 assembly (clang, -O0):
<getnbsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1136 <getnbsize+0x36>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <getnbsize+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnbsize>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <getnbsize+0x1c>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jle    1110 <getnbsize+0x10>
ret

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

LLVM IR (-O2):
define i32 @getnbsize(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = icmp sgt i32 %6, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int I_NoAppServicesSendPacket(void *addr, const void *data, unsigned int size) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesSendPacket(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
char *gai_strerror(int ecode) {
  switch (ecode) {
  case 1:
    return "no address associated with hostname.";
  case 2:
    return "memory allocation failure.";
  default:
    return "unknown error.";
  }
}


x86 assembly (clang, -O0):
<gai_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <gai_strerror+0x2c>
jmp    111b <gai_strerror+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <gai_strerror+0x3c>
jmp    114c <gai_strerror+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <gai_strerror+0x57>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <gai_strerror+0x57>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gai_strerror>:
cmp    $0x2,%edi
lea    0xf1b(%rip),%rax
lea    0xf2f(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"no address associated with hostname.\00"
@.str.1 = [27 x i8] c"memory allocation failure.\00"
@.str.2 = [15 x i8] c"unknown error.\00"
define i8* @gai_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [37 x i8] c"no address associated with hostname.\00"
@.str.1 = [27 x i8] c"memory allocation failure.\00"
@.str.2 = [15 x i8] c"unknown error.\00"
define i8* @gai_strerror(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
unsigned int __blsi_u32(unsigned int);
unsigned int func_blsi32(unsigned int X) { return __blsi_u32(X); }


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

x86 assembly (clang, -O2):
<func_blsi32>:
jmp    1030 <__blsi_u32@plt>

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

LLVM IR (-O2):
define i32 @func_blsi32(i32 %0) {
%2 = tail call i32 @__blsi_u32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ consoleTranslUserAdd(char *, char *, int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
void consoleTranslUserAdd2(char *prefix, char *scriptExpr) {
  consoleTranslUserAdd(prefix, scriptExpr, 0, NULL);
}


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

x86 assembly (clang, -O2):
<consoleTranslUserAdd2>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <consoleTranslUserAdd@plt>

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

LLVM IR (-O2):
define void @consoleTranslUserAdd2(i8* %0, i8* %1) {
%3 = tail call i32 @consoleTranslUserAdd(i8* %0, i8* %1, i32 0, i32* null)
ret void
}
/* Variables and functions */
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ open(char *, int);
void test_open_rdwr() {
  close(open(".throwaway-test-output", O_RDWR | O_TRUNC));
}


x86 assembly (clang, -O0):
<test_open_rdwr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
or     (%rax),%esi
lea    0xec3(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_open_rdwr>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [23 x i8] c".throwaway-test-output\00"
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
define void @test_open_rdwr() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_TRUNC
%3 = or i32 %1, %2
%4 = call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @close(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c".throwaway-test-output\00"
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
define void @test_open_rdwr() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_TRUNC
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
void *encode16(void *, unsigned int);
void *encode_kind(void *attrs, unsigned kind, unsigned version) {
  return encode16(attrs, (kind << 12) | version);
}


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

x86 assembly (clang, -O2):
<encode_kind>:
shl    $0xc,%esi
or     %edx,%esi
jmp    1030 <encode16@plt>

LLVM IR (-O0):
define i8* @encode_kind(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 = shl i32 %8, 12
%10 = load i32, i32* %6
%11 = or i32 %9, %10
%12 = call i8* @encode16(i8* %7, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @encode_kind(i8* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 12
%5 = or i32 %4, %2
%6 = tail call i8* @encode16(i8* %0, i32 %5)
ret i8* %6
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int find_switch(struct graph *, struct graph *, int, int /*<<< orphan*/ *);
int is_switch(struct graph *g0, struct graph *g, int start) {
  return find_switch(g0, g, start, NULL);
}


x86 assembly (clang, -O0):
<is_switch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <find_switch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_switch>:
xor    %ecx,%ecx
jmp    1030 <find_switch@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define i32 @is_switch(%struct.graph* %0, %struct.graph* %1, i32 %2) {
%4 = alloca %struct.graph*
%5 = alloca %struct.graph*
%6 = alloca i32
store %struct.graph* %0, %struct.graph** %4
store %struct.graph* %1, %struct.graph** %5
store i32 %2, i32* %6
%7 = load %struct.graph*, %struct.graph** %4
%8 = load %struct.graph*, %struct.graph** %5
%9 = load i32, i32* %6
%10 = call i32 @find_switch(%struct.graph* %7, %struct.graph* %8, i32 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define i32 @is_switch(%struct.graph* %0, %struct.graph* %1, i32 %2) {
%4 = tail call i32 @find_switch(%struct.graph* %0, %struct.graph* %1, i32 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
bool inside_rect(int x, int y, int left, int top, int width, int height) {
  if (x >= left && x < left + width && y >= top && y < top + height) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<inside_rect>:
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    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     115e <inside_rect+0x5e>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    115e <inside_rect+0x5e>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     115e <inside_rect+0x5e>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    115e <inside_rect+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <inside_rect+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside_rect>:
cmp    %edx,%edi
setge  %r10b
add    %edx,%r8d
cmp    %edi,%r8d
setg   %dl
cmp    %ecx,%esi
setge  %al
and    %r10b,%al
and    %dl,%al
add    %ecx,%r9d
cmp    %esi,%r9d
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @inside_rect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp slt i32 %0, %2
%8 = add nsw i32 %4, %2
%9 = icmp sle i32 %8, %0
%10 = select i1 %7, i1 true, i1 %9
%11 = icmp slt i32 %1, %3
%12 = or i1 %11, %10
%13 = xor i1 %12, true
%14 = add nsw i32 %5, %3
%15 = icmp sgt i32 %14, %1
%16 = select i1 %13, i1 %15, i1 false
%17 = zext i1 %16 to i32
ret i32 %17
}
/* Variables and functions */
int __builtin_rx_mvfc(int /*<<< orphan*/);
int /*<<< orphan*/ __builtin_rx_mvtc(int /*<<< orphan*/, int);
void sysUnlock(void *pvLockObj, int iUnlock) {
  if (!pvLockObj) {
    int iMask = __builtin_rx_mvfc(0);
    iMask &= ~((0x0F) << 24);
    iMask |= ((iUnlock & 0x0F) << 24);
    __builtin_rx_mvtc(0, iMask);
  }
}


x86 assembly (clang, -O0):
<sysUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1168 <sysUnlock+0x48>
xor    %edi,%edi
call   1040 <__builtin_rx_mvfc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xf0ffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
shl    $0x18,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
xor    %edi,%edi
call   1030 <__builtin_rx_mvtc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysUnlock>:
test   %rdi,%rdi
je     1126 <sysUnlock+0x6>
ret
push   %rbx
mov    %esi,%ebx
xor    %edi,%edi
call   1040 <__builtin_rx_mvfc@plt>
and    $0xf0ffffff,%eax
and    $0xf,%ebx
shl    $0x18,%ebx
or     %eax,%ebx
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <__builtin_rx_mvtc@plt>

LLVM IR (-O0):
define void @sysUnlock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %19, label %8
8: ; preds = %2
%9 = call i32 @__builtin_rx_mvfc(i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = and i32 %10, -251658241
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = shl i32 %13, 24
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = call i32 @__builtin_rx_mvtc(i32 0, i32 %17)
br label %19
19: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @sysUnlock(i8* readnone %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i32 @__builtin_rx_mvfc(i32 0)
%6 = and i32 %5, -251658241
%7 = shl i32 %1, 24
%8 = and i32 %7, 251658240
%9 = or i32 %6, %8
%10 = tail call i32 @__builtin_rx_mvtc(i32 0, i32 %9)
br label %11
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t subnet_size(uint8_t subnet) { return (2 << (31 - subnet)) - 2; }


x86 assembly (clang, -O0):
<subnet_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1f,%ecx
sub    -0x4(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subnet_size>:
mov    $0x1f,%cl
sub    %dil,%cl
mov    $0x2,%eax
shl    %cl,%eax
add    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @subnet_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 31, %3
%5 = shl i32 2, %4
%6 = sub nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @subnet_size(i32 %0) {
%2 = sub nsw i32 31, %0
%3 = shl i32 2, %2
%4 = add nsw i32 %3, -2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abs(long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int scanf(char *, long long *, long long *);
int main(void) {
  long long a, b;
  while (scanf("%lld%lld", &a, &b) == 2)
    printf("%lld\n", abs(a - b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    117c <main+0x4c>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebe(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    119c <main+0x6c>
lea    0xeac(%rip),%r14
lea    0xe9c(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    0x10(%rsp),%rdi
sub    0x8(%rsp),%rdi
call   1030 <abs@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = sub nsw i64 %8, %9
%11 = call i32 @abs(i64 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i64, i64* %1
%9 = load i64, i64* %2
%10 = sub nsw i64 %8, %9
%11 = call i32 @abs(i64 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%14 = icmp eq i32 %13, 2
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ USART_Flush();
int /*<<< orphan*/ USART_PutString(int /*<<< orphan*/ *);
void DEBUG_PutString(char *str) {
  USART_PutString((uint8_t *)str);
  USART_Flush();
}


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

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

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

LLVM IR (-O2):
define void @DEBUG_PutString(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @USART_PutString(i32* %2)
%4 = tail call i32 (...) @USART_Flush()
ret void
}
int dirserv_load_fingerprint_file(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dirserv_load_fingerprint_file() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
int /*<<< orphan*/ padding(int);
void ed(int pn) {
  brc(pn, 'J');
  padding(50);
}


x86 assembly (clang, -O0):
<ed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4a,%esi
call   1040 <brc@plt>
mov    $0x32,%edi
call   1030 <padding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ed>:
push   %rax
mov    $0x4a,%esi
call   1040 <brc@plt>
mov    $0x32,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
define void @ed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, i8 signext 74)
%5 = call i32 @padding(i32 50)
ret void
}

LLVM IR (-O2):
define void @ed(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 74)
%3 = tail call i32 @padding(i32 50)
ret void
}
void delay(volatile int count) {
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <delay+0x20>
jmp    1107 <delay+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
subl   $0x1,-0x4(%rsp)
jae    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %2
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
void foo373(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo373(i32 %0) {
ret void
}
long long reverseBits_fun_llong(long long x) {
  long long r = x;
  int i = 63;
  for (x = x >> 1 & 0x7fffffffffffffffll; x; x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3f,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <reverseBits_fun_llong+0x6c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <reverseBits_fun_llong+0x30>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_llong>:
mov    $0x3f,%ecx
cmp    $0x2,%rdi
jae    1112 <reverseBits_fun_llong+0x12>
mov    %rdi,%rax
shl    %cl,%rax
ret
mov    $0x3f,%ecx
mov    %rdi,%rax
mov    %rdi,%rdx
nopl   (%rax)
shr    %rdx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%rax
add    $0xffffffff,%ecx
cmp    $0x3,%rdi
mov    %rdx,%rdi
ja     1120 <reverseBits_fun_llong+0x20>
mov    %ecx,%ecx
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @reverseBits_fun_llong(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 63, %1 ]
%6 = phi i64 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i64 %4, 1
%8 = shl i64 %6, 1
%9 = and i64 %7, 1
%10 = or i64 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i64 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3
%14 = zext i32 %11 to i64
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ %0, %1 ], [ %10, %13 ]
%17 = phi i64 [ 63, %1 ], [ %14, %13 ]
%18 = shl i64 %16, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *msg) {
  fprintf(stderr, "FATAL:  %s", msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"FATAL: %s\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void closeFile(FILE *log) {
  if (ferror(log))
    perror("ERROR WRITING TO FILE:");
  fclose(log);
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     115b <closeFile+0x2b>
lea    0xeaa(%rip),%rdi
call   1050 <perror@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ferror@plt>
test   %rax,%rax
jne    1147 <closeFile+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
lea    0xeb2(%rip),%rdi
call   1050 <perror@plt>
jmp    113e <closeFile+0xe>

LLVM IR (-O0):
@.str = [23 x i8] c"ERROR WRITING TO FILE:\00"
define void @closeFile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @ferror(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"ERROR WRITING TO FILE:\00"
define void @closeFile(i32* nocapture %0) {
%2 = tail call i64 @ferror(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %0)
ret void
}
unsigned char bcdToDec(unsigned char bcd) {
  return (((bcd >> 4) * 10) + (bcd & 0x0F));
}


x86 assembly (clang, -O0):
<bcdToDec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcdToDec>:
mov    %edi,%eax
shr    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @bcdToDec(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = mul nsw i32 %5, 10
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @bcdToDec(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = mul nuw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nuw i8 %3, %4
ret i8 %5
}
void gdk_x11_gc_get_xdisplay() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_gc_get_xdisplay() {
ret void
}
void reset(unsigned char p_data[4][4]) {
  unsigned int i, j;
  for (i = 0; i < 4; i++)
    for (j = 0; j < 4; j++)
      p_data[j][i] = 0;
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jae    1160 <reset+0x60>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    114d <reset+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <reset+0x20>
jmp    1152 <reset+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <reset+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @reset([4 x i8]* nocapture writeonly %0) {
%2 = getelementptr [4 x i8], [4 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int isallone(int);
int isallzero(int start) { return isallone(-start); }


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

x86 assembly (clang, -O2):
<isallzero>:
neg    %edi
jmp    1030 <isallone@plt>

LLVM IR (-O0):
define i32 @isallzero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = call i32 @isallone(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @isallzero(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @isallone(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  register int total = 0;
  for (int i = 0; i <= 100; i++) {
    total += i;
  }
  printf("Sum: %d\n", total);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jg     1155 <main+0x45>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Sum: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %15, %2
%9 = load i32, i32* %7
%10 = icmp sle i32 %9, 100
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = add nsw i32 %13, %12
store i32 %14, i32* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
br label %8
18: ; preds = %8
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"Sum: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void zero_out(void *p, int count) { memset(p, 0, count); }


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

x86 assembly (clang, -O2):
<zero_out>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_out(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 @memset(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @zero_out(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void *RFCNB_Listen() {}


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

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

LLVM IR (-O0):
define i8* @RFCNB_Listen() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @RFCNB_Listen() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int unary_r(char *s) { return !access(s, R_OK); }


x86 assembly (clang, -O0):
<unary_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <access@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):
<unary_r>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@R_OK = global i32 0
define i32 @unary_r(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @R_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@R_OK = global i32 0
define i32 @unary_r(i8* nocapture %0) {
%2 = load i32, i32* @R_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct catmc_atomic_unsigned_int {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_unsigned_int *);
void catmc_atomic_unsigned_int_destroy(
    struct catmc_atomic_unsigned_int *wrapper) {
  free(wrapper);
}


x86 assembly (clang, -O0):
<catmc_atomic_unsigned_int_destroy>:
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):
<catmc_atomic_unsigned_int_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_unsigned_int = type { i32 }
define void @catmc_atomic_unsigned_int_destroy(%struct.catmc_atomic_unsigned_int* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_unsigned_int* %0)
ret void
}