xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgdec2iw(void) { ngen("%s\t(%%edx)", "decl", 0); }


x86 assembly (clang, -O0):
<cgdec2iw>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec2iw>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"decl\00"
define void @cgdec2iw() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"decl\00"
define void @cgdec2iw() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
char tolower(char);
void upper2lower(char *str) {
  char c;
  while ((c = tolower(*str)))
    *str++ = c;
}


x86 assembly (clang, -O0):
<upper2lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     114c <upper2lower+0x3c>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <upper2lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper2lower>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <tolower@plt>
test   %al,%al
je     1143 <upper2lower+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %al,-0x1(%rbx)
movsbl (%rbx),%edi
call   1030 <tolower@plt>
add    $0x1,%rbx
test   %al,%al
jne    1130 <upper2lower+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @upper2lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @tolower(i8 signext %2)
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %3, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
char *__libc_getenv(char const *);
char *getenv(const char *name) { return __libc_getenv(name); }


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

x86 assembly (clang, -O2):
<getenv>:
jmp    1030 <__libc_getenv@plt>

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

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = tail call i8* @__libc_getenv(i8* %0)
ret i8* %2
}
void EthernetIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<EthernetIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetIntDisable>:
not    %rsi
and    %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @EthernetIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 4
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @EthernetIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void y1(void) {
  extern char e;
  fprintf(0, "asdf");
}


x86 assembly (clang, -O0):
<y1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<y1>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define void @y1() {
%1 = tail call i32 @fprintf(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void parent_fn(int nproc) {
  int i;
  for (i = 0; i < nproc; i++)
    wait(NULL);
}


x86 assembly (clang, -O0):
<parent_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1145 <parent_fn+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <wait@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <parent_fn+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_fn>:
push   %rbx
test   %edi,%edi
jle    112c <parent_fn+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <wait@plt>
add    $0xffffffff,%ebx
jne    1120 <parent_fn+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @parent_fn(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @wait(i32* null)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
const char *devicePinGetName() { return "pin"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"pin\00"
define i8* @devicePinGetName() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"pin\00"
define i8* @devicePinGetName() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int socket_write(char const *, int);
int strlen(char const *);
int /*<<< orphan*/ ui_nntp_command_issued(char const *);
int nntp_issue_command(const char *command) {
  int bytes_written;
  bytes_written = socket_write(command, strlen(command));
  if (bytes_written > 0) {
    bytes_written += socket_write("\r\n", 2);
    ui_nntp_command_issued(command);
  }
  return bytes_written;
}


x86 assembly (clang, -O0):
<nntp_issue_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <socket_write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1185 <nntp_issue_command+0x55>
lea    0xe94(%rip),%rdi
mov    $0x2,%esi
call   1040 <socket_write@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ui_nntp_command_issued@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nntp_issue_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <socket_write@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    1166 <nntp_issue_command+0x36>
lea    0xeae(%rip),%rdi
mov    $0x2,%esi
call   1040 <socket_write@plt>
add    %eax,%ebp
mov    %rbx,%rdi
call   1050 <ui_nntp_command_issued@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @nntp_issue_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @socket_write(i8* %4, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = call i32 @socket_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i8*, i8** %2
%15 = call i32 @ui_nntp_command_issued(i8* %14)
br label %16
16: ; preds = %10, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @nntp_issue_command(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @socket_write(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @socket_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%7 = add nsw i32 %6, %3
%8 = tail call i32 @ui_nntp_command_issued(i8* %0)
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ %7, %5 ], [ %3, %1 ]
ret i32 %10
}
void EUSCIB1_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<EUSCIB1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <EUSCIB1_IRQHandler+0x9>
jmp    1109 <EUSCIB1_IRQHandler+0x9>

x86 assembly (clang, -O2):
<EUSCIB1_IRQHandler>:
jmp    1100 <EUSCIB1_IRQHandler>

LLVM IR (-O0):
define void @EUSCIB1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @EUSCIB1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  x = 1234;
  print_int(x);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4d2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xec2(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d2,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i32 1234)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
not_duplicate(num, arr, n) double num, arr[];
int n;
{
  int m;
  for (m = 1; m <= n; ++m) {
    if (num == arr[m])
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<not_duplicate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1160 <not_duplicate+0x60>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    114d <not_duplicate+0x4d>
jp     114d <not_duplicate+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <not_duplicate+0x67>
jmp    1152 <not_duplicate+0x52>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <not_duplicate+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_duplicate>:
mov    $0x1,%eax
test   %esi,%esi
jle    1136 <not_duplicate+0x36>
add    $0x1,%esi
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
jne    112d <not_duplicate+0x2d>
jnp    1137 <not_duplicate+0x37>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1120 <not_duplicate+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @not_duplicate(double %0, double* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = add nuw i32 %2, 1
%7 = zext i32 %6 to i64
br label %11
8: ; preds = %11
%9 = add nuw nsw i64 %12, 1
%10 = icmp eq i64 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %5, %8
%12 = phi i64 [ 1, %5 ], [ %9, %8 ]
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = load double, double* %13
%15 = fcmp oeq double %14, %0
br i1 %15, label %16, label %8
16: ; preds = %11, %8, %3
%17 = phi i32 [ 1, %3 ], [ 1, %8 ], [ 0, %11 ]
ret i32 %17
}
int hash_plugin_is_special(void) { return 1; }


x86 assembly (clang, -O0):
<hash_plugin_is_special>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_plugin_is_special() {
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_plugin_is_special() {
ret i32 1
}
int max_variable(void) { return 64; }


x86 assembly (clang, -O0):
<max_variable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max_variable() {
ret i32 64
}

LLVM IR (-O2):
define i32 @max_variable() {
ret i32 64
}
/* Variables and functions */
int func1();
int func2();
int main(void) { return func1() - func2(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <func1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <func2@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func1()
%3 = call i32 (...) @func2()
%4 = sub nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 (...) @func2()
%3 = sub nsw i32 %1, %2
ret i32 %3
}
/* Variables and functions */
int f274(int *);
int f275(int *p) { return f274(p); }


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

x86 assembly (clang, -O2):
<f275>:
jmp    1030 <f274@plt>

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

LLVM IR (-O2):
define i32 @f275(i32* %0) {
%2 = tail call i32 @f274(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
char *strrchr(char const *, char);
void print_usage(const char *progname) {
  const char *unified_progname;
  if (!(unified_progname = strrchr(progname, '/')))
    unified_progname = progname;
  else
    unified_progname++;
  printf("\n%s [options] [FILE]\n\n"
         "  options:\n"
         "    -h | --help         print this help\n"
         "    -f | --file         read lines from FILE\n"
         "\n"
         "Sort lines of text files. Use '-' to denote STDIN\n",
         unified_progname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1155 <print_usage+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <print_usage+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [170 x i8] c"\0A%s [options] [FILE]\0A\0A options:\0A -h | --help print this help\0A -f | --file read lines from FILE\0A\0ASort lines of text files. Use '-' to denote STDIN\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
store i8* %8, i8** %3
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %12
12: ; preds = %9, %7
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c"\0A%s [options] [FILE]\0A\0A options:\0A -h | --help print this help\0A -f | --file read lines from FILE\0A\0ASort lines of text files. Use '-' to denote STDIN\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
int exe$flush(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$flush>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$flush"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$flush"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void terminate_rendering_system() {}


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

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

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

LLVM IR (-O2):
define void @terminate_rendering_system() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scope1();
int /*<<< orphan*/ scope2();
int main(void) {
  scope1();
  scope2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <scope1@plt>
mov    $0x0,%al
call   1040 <scope2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <scope1@plt>
xor    %eax,%eax
call   1040 <scope2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @scope1()
%2 = call i32 (...) @scope2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @scope1()
%2 = tail call i32 (...) @scope2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_print(char *arr) {
  fprintf(stderr, "\n%s unfolds the phase saved in a Gnuplot format\n", arr);
  fprintf(stderr,
          "\nUSAGE: %s  K rad < phase_in > phase_out \nwhere K is coefficient "
          "to multiply the phase, may be\nnecessary to translate the phase "
          "into dimensional units.\nrad is the radius of blackening aperture. "
          "relative to grid size\n",
          arr);
}


x86 assembly (clang, -O0):
<error_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef7(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"\0A%s unfolds the phase saved in a Gnuplot format\0A\00"
@.str.1 = [217 x i8] c"\0AUSAGE: %s K rad < phase_in > phase_out \0Awhere K is coefficient to multiply the phase, may be\0Anecessary to translate the phase into dimensional units.\0Arad is the radius of blackening aperture. relative to grid size\0A\00"
define void @error_print(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 ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"\0A%s unfolds the phase saved in a Gnuplot format\0A\00"
@.str.1 = [217 x i8] c"\0AUSAGE: %s K rad < phase_in > phase_out \0Awhere K is coefficient to multiply the phase, may be\0Anecessary to translate the phase into dimensional units.\0Arad is the radius of blackening aperture. relative to grid size\0A\00"
define void @error_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int write_buffers(void) { return 1; }


x86 assembly (clang, -O0):
<write_buffers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @write_buffers() {
ret i32 1
}

LLVM IR (-O2):
define i32 @write_buffers() {
ret i32 1
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int test_clock_gettime() {
  struct timespec tp;
  return clock_gettime(CLOCK_MONOTONIC, &tp);
}


x86 assembly (clang, -O0):
<test_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_clock_gettime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @test_clock_gettime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
ret i32 %3
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @test_clock_gettime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
ret i32 %4
}
unsigned char _sdcc_external_startup() { return 0; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @_sdcc_external_startup() {
ret i8 0
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Lex_strng_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_strng(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_Lex_strng_rec(lexbuf, 3); });
}


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

x86 assembly (clang, -O2):
<Cyc_Lex_strng>:
mov    $0x3,%esi
jmp    1030 <Cyc_Lex_strng_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_strng_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 3)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_strng_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 3)
ret i32 %2
}
double fmod(double a, double b) { return a - (b * (int)(a / b)); }


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
divsd  -0x10(%rbp),%xmm2
cvttsd2si %xmm2,%eax
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
%11 = sitofp i32 %10 to double
%12 = fneg double %6
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %5)
ret double %13
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %0)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_ecc(int /*<<< orphan*/ *);
int /*<<< orphan*/ add_edc(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ add_header(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ add_xa_subheader(int /*<<< orphan*/ *);
void convert_track_xa_form_1_2048(uint8_t *sector, uint32_t adr) {
  add_header(sector, 0, 0);
  add_xa_subheader(sector);
  add_edc(sector + 16, 8 + 2048, sector + 2072);
  add_ecc(sector);
  add_header(sector, adr, 2);
}


x86 assembly (clang, -O0):
<convert_track_xa_form_1_2048>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <add_header@plt>
mov    -0x8(%rbp),%rdi
call   1030 <add_xa_subheader@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rdx
add    $0x2060,%rdx
mov    $0x808,%esi
call   1040 <add_edc@plt>
mov    -0x8(%rbp),%rdi
call   1060 <add_ecc@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1050 <add_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_xa_form_1_2048>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1050 <add_header@plt>
mov    %rbx,%rdi
call   1030 <add_xa_subheader@plt>
lea    0x40(%rbx),%rdi
lea    0x2060(%rbx),%rdx
mov    $0x808,%esi
call   1040 <add_edc@plt>
mov    %rbx,%rdi
call   1060 <add_ecc@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <add_header@plt>

LLVM IR (-O0):
define void @convert_track_xa_form_1_2048(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @add_header(i32* %5, i32 0, i32 0)
%7 = load i32*, i32** %3
%8 = call i32 @add_xa_subheader(i32* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2072
%13 = call i32 @add_edc(i32* %10, i32 2056, i32* %12)
%14 = load i32*, i32** %3
%15 = call i32 @add_ecc(i32* %14)
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = call i32 @add_header(i32* %16, i32 %17, i32 2)
ret void
}

LLVM IR (-O2):
define void @convert_track_xa_form_1_2048(i32* %0, i32 %1) {
%3 = tail call i32 @add_header(i32* %0, i32 0, i32 0)
%4 = tail call i32 @add_xa_subheader(i32* %0)
%5 = getelementptr inbounds i32, i32* %0, i64 16
%6 = getelementptr inbounds i32, i32* %0, i64 2072
%7 = tail call i32 @add_edc(i32* %5, i32 2056, i32* %6)
%8 = tail call i32 @add_ecc(i32* %0)
%9 = tail call i32 @add_header(i32* %0, i32 %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char buf[10];
  char str[] = "hello";
  copy(str, buf);
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <copy@plt>
lea    -0xe(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
mov    %rsp,%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <copy@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"hello\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %3 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @copy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"hello\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @copy(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned srl(unsigned x, int k) {
  unsigned xsra = (int)x >> k;
  unsigned mask = k ? ((1 << (8 * sizeof(int) - k)) - 1) : ~0;
  return mask & xsra;
}


x86 assembly (clang, -O0):
<srl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <srl+0x3f>
movslq -0x8(%rbp),%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <srl+0x4c>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <srl+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srl>:
mov    %esi,%ecx
sar    %cl,%edi
neg    %cl
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
cmp    $0x1,%esi
sbb    %eax,%eax
or     %edx,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @srl(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
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = sub i64 32, %14
%16 = trunc i64 %15 to i32
%17 = shl i32 1, %16
%18 = sub nsw i32 %17, 1
br label %20
19: ; preds = %2
br label %20
20: ; preds = %19, %12
%21 = phi i32 [ %18, %12 ], [ -1, %19 ]
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = and i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @srl(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = icmp eq i32 %1, 0
%5 = sub i32 32, %1
%6 = shl nsw i32 -1, %5
%7 = xor i32 %6, -1
%8 = select i1 %4, i32 -1, i32 %7
%9 = and i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int bcmp(const void *str1, const void *str2, size_t count) {
  return memcmp(str1, str2, count);
}


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

x86 assembly (clang, -O2):
<bcmp>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, ...);
int lbs_posix_add_fl(int fd, int flflags) {
  int orgfl = fcntl(fd, F_GETFL);
  if (orgfl < 0) {
    return -1;
  }
  return fcntl(fd, F_SETFL, orgfl | flflags);
}


x86 assembly (clang, -O0):
<lbs_posix_add_fl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114a <lbs_posix_add_fl+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <lbs_posix_add_fl+0x56>
mov    -0x8(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
or     -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_posix_add_fl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1147 <lbs_posix_add_fl+0x37>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
or     %ebp,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @lbs_posix_add_fl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @F_GETFL
%9 = call i32 (i32, i32, ...) @fcntl(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* @F_SETFL
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = or i32 %16, %17
%19 = call i32 (i32, i32, ...) @fcntl(i32 %14, i32 %15, i32 %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @lbs_posix_add_fl(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @F_SETFL
%8 = or i32 %4, %1
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ AudioMixer_cleanup();
int /*<<< orphan*/ AudioMixer_init();
int /*<<< orphan*/ Door_init();
int /*<<< orphan*/ Keypad_init();
int /*<<< orphan*/ Keypad_unInit();
int /*<<< orphan*/ server_init();
int /*<<< orphan*/ server_join();
int /*<<< orphan*/ test_keypad();
int main() {
  AudioMixer_init();
  server_init();
  Keypad_init();
  Door_init();
  test_keypad();
  server_join();
  Keypad_unInit();
  AudioMixer_cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <AudioMixer_init@plt>
mov    $0x0,%al
call   1050 <server_init@plt>
mov    $0x0,%al
call   1040 <Keypad_init@plt>
mov    $0x0,%al
call   1060 <Door_init@plt>
mov    $0x0,%al
call   1070 <test_keypad@plt>
mov    $0x0,%al
call   10a0 <server_join@plt>
mov    $0x0,%al
call   1090 <Keypad_unInit@plt>
mov    $0x0,%al
call   1080 <AudioMixer_cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <AudioMixer_init@plt>
xor    %eax,%eax
call   1050 <server_init@plt>
xor    %eax,%eax
call   1040 <Keypad_init@plt>
xor    %eax,%eax
call   1060 <Door_init@plt>
xor    %eax,%eax
call   1070 <test_keypad@plt>
xor    %eax,%eax
call   10a0 <server_join@plt>
xor    %eax,%eax
call   1090 <Keypad_unInit@plt>
xor    %eax,%eax
call   1080 <AudioMixer_cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @AudioMixer_init()
%3 = call i32 (...) @server_init()
%4 = call i32 (...) @Keypad_init()
%5 = call i32 (...) @Door_init()
%6 = call i32 (...) @test_keypad()
%7 = call i32 (...) @server_join()
%8 = call i32 (...) @Keypad_unInit()
%9 = call i32 (...) @AudioMixer_cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @AudioMixer_init()
%2 = tail call i32 (...) @server_init()
%3 = tail call i32 (...) @Keypad_init()
%4 = tail call i32 (...) @Door_init()
%5 = tail call i32 (...) @test_keypad()
%6 = tail call i32 (...) @server_join()
%7 = tail call i32 (...) @Keypad_unInit()
%8 = tail call i32 (...) @AudioMixer_cleanup()
ret i32 0
}
/* Variables and functions */
int read_port_byte(int);
int /*<<< orphan*/ write_port_byte(int, int);
int get_cursor() {
  int offset;
  write_port_byte(0x03d4, 0x0e);
  offset = read_port_byte(0x03d5) << 8;
  write_port_byte(0x03d4, 0x0f);
  offset += read_port_byte(0x03d5);
  return offset * 2;
}


x86 assembly (clang, -O0):
<get_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port_byte@plt>
mov    $0x3d5,%edi
call   1040 <read_port_byte@plt>
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port_byte@plt>
mov    $0x3d5,%edi
call   1040 <read_port_byte@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cursor>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port_byte@plt>
mov    $0x3d5,%edi
call   1040 <read_port_byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port_byte@plt>
mov    $0x3d5,%edi
call   1040 <read_port_byte@plt>
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_cursor() {
%1 = alloca i32
%2 = call i32 @write_port_byte(i32 980, i32 14)
%3 = call i32 @read_port_byte(i32 981)
%4 = shl i32 %3, 8
store i32 %4, i32* %1
%5 = call i32 @write_port_byte(i32 980, i32 15)
%6 = call i32 @read_port_byte(i32 981)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_cursor() {
%1 = tail call i32 @write_port_byte(i32 980, i32 14)
%2 = tail call i32 @read_port_byte(i32 981)
%3 = shl i32 %2, 8
%4 = tail call i32 @write_port_byte(i32 980, i32 15)
%5 = tail call i32 @read_port_byte(i32 981)
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
ret i32 %7
}
void foo517(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo517(i32 %0) {
ret void
}
void mfence() { asm volatile("mfence;" : : :); }


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

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

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

LLVM IR (-O2):
define void @mfence() {
tail call void asm sideeffect "mfence;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned char ds1337_dec_to_bcd(unsigned char, int);
int /*<<< orphan*/ ds1337_write_register(int, unsigned char);
void ds1337_set_minutes(unsigned char minutes) {
  minutes = ds1337_dec_to_bcd(minutes, 3);
  ds1337_write_register(0x01, minutes);
}


x86 assembly (clang, -O0):
<ds1337_set_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%esi
movzbl -0x1(%rbp),%edi
call   1040 <ds1337_dec_to_bcd@plt>
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <ds1337_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_set_minutes>:
push   %rax
mov    $0x3,%esi
call   1040 <ds1337_dec_to_bcd@plt>
movzbl %al,%esi
mov    $0x1,%edi
pop    %rax
jmp    1030 <ds1337_write_register@plt>

LLVM IR (-O0):
define void @ds1337_set_minutes(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @ds1337_dec_to_bcd(i8 zeroext %3, i32 3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i32 @ds1337_write_register(i32 1, i8 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @ds1337_set_minutes(i8 zeroext %0) {
%2 = tail call zeroext i8 @ds1337_dec_to_bcd(i8 zeroext %0, i32 3)
%3 = tail call i32 @ds1337_write_register(i32 1, i8 zeroext %2)
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INET_ADDRSTRLEN;
int /*<<< orphan*/ Inet_ntop(int /*<<< orphan*/, void const *, char *,
                             int /*<<< orphan*/);
scalar_t__ Malloc(int /*<<< orphan*/);
char *InAddr_to_string(in_addr_t x) {
  struct in_addr y;
  char *retval = (char *)Malloc(INET_ADDRSTRLEN);
  y.s_addr = x;
  Inet_ntop(AF_INET, (const void *)&y, retval, INET_ADDRSTRLEN);
  return retval;
  ;
}


x86 assembly (clang, -O0):
<InAddr_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <Malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2e7d(%rip),%rax
mov    (%rax),%ecx
call   1040 <Inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InAddr_to_string>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
mov    0x2ea7(%rip),%r14
mov    (%r14),%edi
call   1030 <Malloc@plt>
mov    %rax,%rbx
mov    %ebp,0x8(%rsp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%ecx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1040 <Inet_ntop@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INET_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
define i8* @InAddr_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* @INET_ADDRSTRLEN
%6 = call i64 @Malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i32, i32* %2
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* @AF_INET
%11 = bitcast %struct.in_addr* %3 to i8*
%12 = load i8*, i8** %4
%13 = load i32, i32* @INET_ADDRSTRLEN
%14 = call i32 @Inet_ntop(i32 %10, i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INET_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
define i8* @InAddr_to_string(i32 %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = load i32, i32* @INET_ADDRSTRLEN
%5 = tail call i64 @Malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
store i32 %0, i32* %7
%8 = load i32, i32* @AF_INET
%9 = load i32, i32* @INET_ADDRSTRLEN
%10 = call i32 @Inet_ntop(i32 %8, i8* %3, i8* %6, i32 %9)
ret i8* %6
}