xunge/DecIR huggingface dataset:
int ehDivisivelPor3ou5(int n) {
  if ((n % 3 == 0 && n % 5 == 0) || (n % 3 != 0 && n % 5 != 0)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<ehDivisivelPor3ou5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <ehDivisivelPor3ou5+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1157 <ehDivisivelPor3ou5+0x57>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <ehDivisivelPor3ou5+0x63>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <ehDivisivelPor3ou5+0x63>
movl   $0x0,-0x4(%rbp)
jmp    116a <ehDivisivelPor3ou5+0x6a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehDivisivelPor3ou5>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%edx
sub    %ecx,%edx
sete   %r8b
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%eax
sete   %cl
or     %edx,%eax
setne  %al
or     %r8b,%cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ehDivisivelPor3ou5(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 5
%5 = icmp eq i32 %4, 0
%6 = or i32 %2, %4
%7 = icmp ne i32 %6, 0
%8 = or i1 %3, %5
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void common_close(void) {}


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

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

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

LLVM IR (-O2):
define void @common_close() {
ret void
}
int main() {
  int gino = 42;
  return gino;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ Con_PrintSilent(char const *);
void CL_GameModule_PrintToLog(const char *msg) { Con_PrintSilent(msg); }


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

x86 assembly (clang, -O2):
<CL_GameModule_PrintToLog>:
jmp    1030 <Con_PrintSilent@plt>

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

LLVM IR (-O2):
define void @CL_GameModule_PrintToLog(i8* %0) {
%2 = tail call i32 @Con_PrintSilent(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__30__IO__makeInput();
void CC2420TransmitP__CCA__makeInput(void) {
  HplAtm128GeneralIOPinP__30__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CCA__makeInput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__30__IO__makeInput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
void report_fatal_error(char *pgm_name, char *param, char *error_msg) {
  fprintf(stderr, "%s: ERROR - \"%s\" %s\n", pgm_name, param, error_msg);
  fprintf(stderr, "Usage is: %s [-l] [-w] [-c] <textfile\n", pgm_name);
  exit(1);
}


x86 assembly (clang, -O0):
<report_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_fatal_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    0x2eac(%rip),%r14
mov    (%r14),%edi
lea    0xec2(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"%s: ERROR - \22%s\22 %s\0A\00"
@.str.1 = [39 x i8] c"Usage is: %s [-l] [-w] [-c] <textfile\0A\00"
define void @report_fatal_error(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 i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %4
%14 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"%s: ERROR - \22%s\22 %s\0A\00"
@.str.1 = [39 x i8] c"Usage is: %s [-l] [-w] [-c] <textfile\0A\00"
define void @report_fatal_error(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
}
char bracket(char c) {
  return c == '<' ? '>' : c == '{' ? '}' : c == '[' ? ']' : c == '(' ? ')' : c;
}


x86 assembly (clang, -O0):
<bracket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3c,%eax
jne    1124 <bracket+0x24>
mov    $0x3e,%eax
mov    %eax,-0x8(%rbp)
jmp    118b <bracket+0x8b>
movsbl -0x1(%rbp),%eax
cmp    $0x7b,%eax
jne    113e <bracket+0x3e>
mov    $0x7d,%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <bracket+0x85>
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
jne    1158 <bracket+0x58>
mov    $0x5d,%eax
mov    %eax,-0x10(%rbp)
jmp    117f <bracket+0x7f>
movsbl -0x1(%rbp),%eax
cmp    $0x28,%eax
jne    1172 <bracket+0x72>
mov    $0x29,%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <bracket+0x79>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bracket>:
cmp    $0x3c,%dil
je     1115 <bracket+0x15>
cmp    $0x5b,%dil
je     1118 <bracket+0x18>
cmp    $0x7b,%dil
jne    111b <bracket+0x1b>
mov    $0x7d,%al
ret
mov    $0x3e,%al
ret
mov    $0x5d,%al
ret
cmp    $0x28,%dil
movzbl %dil,%ecx
mov    $0x29,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @bracket(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 60
br i1 %5, label %6, label %7
6: ; preds = %1
br label %31
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 123
br i1 %10, label %11, label %12
11: ; preds = %7
br label %29
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 91
br i1 %15, label %16, label %17
16: ; preds = %12
br label %27
17: ; preds = %12
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 40
br i1 %20, label %21, label %22
21: ; preds = %17
br label %25
22: ; preds = %17
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
br label %25
25: ; preds = %22, %21
%26 = phi i32 [ 41, %21 ], [ %24, %22 ]
br label %27
27: ; preds = %25, %16
%28 = phi i32 [ 93, %16 ], [ %26, %25 ]
br label %29
29: ; preds = %27, %11
%30 = phi i32 [ 125, %11 ], [ %28, %27 ]
br label %31
31: ; preds = %29, %6
%32 = phi i32 [ 62, %6 ], [ %30, %29 ]
%33 = trunc i32 %32 to i8
ret i8 %33
}

LLVM IR (-O2):
define signext i8 @bracket(i8 signext %0) {
switch i8 %0, label %2 [
i8 60, label %7
i8 123, label %5
i8 91, label %6
]
2: ; preds = %1
%3 = icmp eq i8 %0, 40
%4 = select i1 %3, i8 41, i8 %0
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %2
%8 = phi i8 [ 62, %1 ], [ %4, %2 ], [ 125, %5 ], [ 93, %6 ]
ret i8 %8
}
int util_isnumeric(const char *str) {
  for (; *str; str++)
    if (*str < '0' || *str > '9')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<util_isnumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <util_isnumeric+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1135 <util_isnumeric+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1141 <util_isnumeric+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115e <util_isnumeric+0x5e>
jmp    1146 <util_isnumeric+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <util_isnumeric+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_isnumeric>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <util_isnumeric+0x23>
add    $0x1,%rdi
nop
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <util_isnumeric+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <util_isnumeric+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @util_isnumeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -58
%11 = icmp ult i8 %10, -10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int rename(const char *old, const char *new) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
main(n) {
  gets(&n);
  printf("%d", n % 85 - 43);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
mov    -0x4(%rbp),%eax
mov    $0x55,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
sub    $0x2b,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1040 <gets@plt>
movslq 0x4(%rsp),%rsi
imul   $0x60606061,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x55,%eax,%eax
sub    %eax,%esi
add    $0xffffffd5,%esi
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32*, ...) bitcast (i32 (...)* @gets to i32 (i32*, ...)*)(i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 85
%6 = sub nsw i32 %5, 43
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32*, ...) bitcast (i32 (...)* @gets to i32 (i32*, ...)*)(i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 85
%6 = add nsw i32 %5, -43
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
unsigned int ketama_hash(const char *inString) {
  unsigned char digest[16], ret;
  (inString, digest);
  ret = (digest[3] << 24) | (digest[2] << 16) | (digest[1] << 8) | digest[0];
  return ret;
}


x86 assembly (clang, -O0):
<ketama_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movzbl -0x1d(%rbp),%eax
shl    $0x18,%eax
movzbl -0x1e(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x1f(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x20(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ketama_hash(i8* nocapture readnone %0) {
ret i32 0
}
void nand_deselect(void) {
  (*((volatile unsigned long *)0x4E000004)) |= (1 << 1);
}


x86 assembly (clang, -O0):
<nand_deselect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000004,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x4e000004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_deselect>:
orq    $0x2,0x4e000004
4e 02
ret

LLVM IR (-O0):
define void @nand_deselect() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_deselect() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
struct udcFile {
  int dummy;
};

/* Variables and functions */
unsigned int byteSwap32(unsigned int);
int /*<<< orphan*/ udcMustRead(struct udcFile *, unsigned int *, int);
unsigned udcReadBits32(struct udcFile *file, int isSwapped) {
  unsigned val;
  udcMustRead(file, &val, sizeof(val));
  if (isSwapped)
    val = byteSwap32(val);
  return val;
}


x86 assembly (clang, -O0):
<udcReadBits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <udcMustRead@plt>
cmpl   $0x0,-0xc(%rbp)
je     1156 <udcReadBits32+0x36>
mov    -0x10(%rbp),%edi
call   1030 <byteSwap32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udcReadBits32>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <udcMustRead@plt>
mov    0xc(%rsp),%eax
test   %ebx,%ebx
je     1145 <udcReadBits32+0x25>
mov    %eax,%edi
call   1030 <byteSwap32@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.udcFile = type { i32 }
define i32 @udcReadBits32(%struct.udcFile* %0, i32 %1) {
%3 = alloca %struct.udcFile*
%4 = alloca i32
%5 = alloca i32
store %struct.udcFile* %0, %struct.udcFile** %3
store i32 %1, i32* %4
%6 = load %struct.udcFile*, %struct.udcFile** %3
%7 = call i32 @udcMustRead(%struct.udcFile* %6, i32* %5, i32 4)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @byteSwap32(i32 %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.udcFile = type { i32 }
define i32 @udcReadBits32(%struct.udcFile* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @udcMustRead(%struct.udcFile* %0, i32* %3, i32 4)
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call i32 @byteSwap32(i32 %7)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ %7, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void udpsend_tilde_closesocket(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<udpsend_tilde_closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @udpsend_tilde_closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exvwarning(int, char const *, int /*<<< orphan*/);
void sh_vwarnx(const char *fmt, va_list ap) { exvwarning(-1, fmt, ap); }


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

x86 assembly (clang, -O2):
<sh_vwarnx>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <exvwarning@plt>

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

LLVM IR (-O2):
define void @sh_vwarnx(i8* %0, i32 %1) {
%3 = tail call i32 @exvwarning(i32 -1, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
void print_center(char *text) {
  int space;
  int i;
  space = 40 - strlen(text) / 2;
  for (i = 0; i < space; i++)
    printf(" ");
  puts(text);
}


x86 assembly (clang, -O0):
<print_center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x28,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1186 <print_center+0x56>
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <print_center+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_center>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
cmp    $0x4f,%eax
jg     115f <print_center+0x2f>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    $0x28,%ebp
sub    %ecx,%ebp
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <print_center+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
define void @print_center(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 80
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = sdiv i32 %2, -2
%6 = add nsw i32 %5, 39
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @putchar(i32 32)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %1
%13 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
int sum(int n) {
  if (n == 1)
    return 1;
  else
    return sum(n - 1) + n;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <sum+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <sum+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1124 <sum+0x24>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %ecx,%eax
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add i32 %0, -3
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}
/* Variables and functions */
void strcat(char *s, char *t) {
  while (*s != '\0')
    s++;
  while (*t != '\0')
    *s++ = *t++;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <strcat+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat+0xc>
jmp    1132 <strcat+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <strcat+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1132 <strcat+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
mov    (%rsi),%al
test   %al,%al
je     1131 <strcat+0x31>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,-0x1(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define void @strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = phi i8* [ %16, %11 ], [ %4, %8 ]
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %12, i8* %14
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
ret void
}
void push(unsigned int stack[], unsigned int item) {
  int stack_max = sizeof(stack);
  for (int i = 0; i <= stack_max; i++) {
    stack[i] = stack[i + 1];
  }
  stack[stack_max] = item;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     114e <push+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <push+0x19>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movups 0x4(%rdi),%xmm0
movups 0x14(%rdi),%xmm1
movups %xmm0,(%rdi)
movups %xmm1,0x10(%rdi)
mov    %esi,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @push(i32* nocapture %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = getelementptr i32, i32* %0, i64 1
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %1, i32* %6
ret void
}
int setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup() {
ret i32 0
}
void __XALT_my_hostname_parser_cleanup_xalt_1_5() {}


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

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

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

LLVM IR (-O2):
define void @__XALT_my_hostname_parser_cleanup_xalt_1_5() {
ret void
}
/* Type definitions */
struct scsi_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ scsi_internal_device_block(struct scsi_device *);
void device_block(struct scsi_device *sdev, void *data) {
  {
    scsi_internal_device_block(sdev);
    return;
  }
}


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

x86 assembly (clang, -O2):
<device_block>:
jmp    1030 <scsi_internal_device_block@plt>

LLVM IR (-O0):
%struct.scsi_device = type { i32 }
define void @device_block(%struct.scsi_device* %0, i8* %1) {
%3 = alloca %struct.scsi_device*
%4 = alloca i8*
store %struct.scsi_device* %0, %struct.scsi_device** %3
store i8* %1, i8** %4
%5 = load %struct.scsi_device*, %struct.scsi_device** %3
%6 = call i32 @scsi_internal_device_block(%struct.scsi_device* %5)
ret void
}

LLVM IR (-O2):
%struct.scsi_device = type { i32 }
define void @device_block(%struct.scsi_device* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @scsi_internal_device_block(%struct.scsi_device* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_tne();
void vm_op_tne(void) {
  op_tne();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vm_op_tne() {
%1 = tail call i32 (...) @op_tne()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double time2day_percentage(int, int);
int main() {
  double results = time2day_percentage(12, 15);
  printf("should be .50104 is %lf\n", results);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
mov    $0xf,%esi
call   1030 <time2day_percentage@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"should be .50104 is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call double @time2day_percentage(i32 12, i32 15)
store double %3, double* %2
%4 = load double, double* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"should be .50104 is %lf\0A\00"
define i32 @main() {
%1 = tail call double @time2day_percentage(i32 12, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
char cos(char);
char sin(char);
char internal_cot_b(char value) { return cos(value) / sin(value); }


x86 assembly (clang, -O0):
<internal_cot_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
call   1040 <cos@plt>
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
call   1030 <sin@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movsbl %cl,%ecx
cltd
idiv   %ecx
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_cot_b>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <cos@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <sin@plt>
movsbl %bpl,%ecx
movsbl %al,%esi
mov    %ecx,%eax
cwtd
idiv   %si
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @internal_cot_b(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @cos(i8 signext %3)
%5 = sext i8 %4 to i32
%6 = load i8, i8* %2
%7 = call signext i8 @sin(i8 signext %6)
%8 = sext i8 %7 to i32
%9 = sdiv i32 %5, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @internal_cot_b(i8 signext %0) {
%2 = tail call signext i8 @cos(i8 signext %0)
%3 = tail call signext i8 @sin(i8 signext %0)
%4 = sext i8 %2 to i16
%5 = sext i8 %3 to i16
%6 = sdiv i16 %4, %5
%7 = trunc i16 %6 to i8
ret i8 %7
}
void testthis(int bla) {}


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

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

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

LLVM IR (-O2):
define void @testthis(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome(void) {
  printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!   "
         "WELCOME   !!!!!!!!!!!!!!!!!!!!\n\n\n\n\n\n\n\n\n\n");
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A!!!!!!!!!!!!!!!!!!!!!!!! WELCOME !!!!!!!!!!!!!!!!!!!!\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [87 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A!!!!!!!!!!!!!!!!!!!!!!!! WELCOME !!!!!!!!!!!!!!!!!!!!\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_null(char **var) {
  if (*var) {
    free(*var);
    *var = NULL;
  }
}


x86 assembly (clang, -O0):
<free_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <free_null+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_null>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <free_null+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_null(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
void cirfil_(mask, npix, nrast) float mask[];
int *npix, *nrast;
{ circle_fill(mask, *npix, *nrast); }


x86 assembly (clang, -O0):
<cirfil_>:
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),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <circle_fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cirfil_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
xor    %eax,%eax
jmp    1030 <circle_fill@plt>

LLVM IR (-O0):
define void @cirfil_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @circle_fill to i32 (float*, i32, i32, ...)*)(float* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @cirfil_(float* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @circle_fill to i32 (float*, i32, i32, ...)*)(float* %0, i32 %4, i32 %5)
ret void
}
void foo_1_2_1_2_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_2_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
size_t write(int, void const *, size_t);
void swrite(int fd, const void *buf, size_t count) {
  size_t ret;
  ret = write(fd, buf, count);
  if (ret != count) {
    fprintf(stderr, "cannot write()\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<swrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1188 <swrite+0x58>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swrite>:
push   %rbx
mov    %rdx,%rbx
call   1030 <write@plt>
cmp    %rbx,%rax
jne    1140 <swrite+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"cannot write()\0A\00"
@EXIT_FAILURE = global i32 0
define void @swrite(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @write(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"cannot write()\0A\00"
@EXIT_FAILURE = global i32 0
define void @swrite(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void request_sem(int id, int num) {
  struct sembuf sb;
  sb.sem_num = num;
  sb.sem_op = -1;
  sb.sem_flg = 0;
  semop(id, &sb, 1);
}


x86 assembly (clang, -O0):
<request_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_sem>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @request_sem(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
int pathcon_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathcon_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathcon_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathcon_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathcon_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathcon_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm3_work>:
test   %rdi,%rdi
je     110b <pathcon_nm3_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <pathcon_nm3_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathcon_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathcon_nm3_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pathcon_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}