xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ irc_list();
int /*<<< orphan*/ mu_fail(char *);
int /*<<< orphan*/ read_mock(char *);
scalar_t__ strcmp(char *, char *);
void test_irc_list() {
  char msg[(512 + 1)];
  irc_list();
  read_mock(msg);
  do {
    if (!((strcmp(msg, "LIST\r\n") == 0))) {
      mu_fail("test_irc_list: msg should be 'LIST\\r\\n'");
      return;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<test_irc_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    $0x0,%al
call   1030 <irc_list@plt>
lea    -0x210(%rbp),%rdi
call   1060 <read_mock@plt>
lea    -0x210(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118c <test_irc_list+0x4c>
lea    0xe85(%rip),%rdi
call   1050 <mu_fail@plt>
jmp    1191 <test_irc_list+0x51>
jmp    1191 <test_irc_list+0x51>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_irc_list>:
push   %rbx
sub    $0x210,%rsp
xor    %eax,%eax
call   1030 <irc_list@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <read_mock@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117a <test_irc_list+0x3a>
lea    0xe92(%rip),%rdi
call   1050 <mu_fail@plt>
add    $0x210,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"LIST\0D\0A\00"
@.str.1 = [40 x i8] c"test_irc_list: msg should be 'LIST\\r\\n'\00"
define void @test_irc_list() {
%1 = alloca [513 x i8]
%2 = call i32 (...) @irc_list()
%3 = getelementptr inbounds [513 x i8], [513 x i8]* %1, i64 0, i64 0
%4 = call i32 @read_mock(i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [513 x i8], [513 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @mu_fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %12
11: ; preds = %5
br label %12
12: ; preds = %9, %11
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"LIST\0D\0A\00"
@.str.1 = [40 x i8] c"test_irc_list: msg should be 'LIST\\r\\n'\00"
define void @test_irc_list() {
%1 = alloca [513 x i8]
%2 = getelementptr inbounds [513 x i8], [513 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @irc_list()
%4 = call i32 @read_mock(i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @mu_fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
ret void
}
/* Type definitions */
struct sqlca_t {
  int dummy;
};

/* Variables and functions */
int OCDB_PGSetLibErrorStatus(struct sqlca_t *, int);
int OCDBSetLibErrorStatus(struct sqlca_t *st, int errno) {
  int retval;
  retval = OCDB_PGSetLibErrorStatus(st, errno);
  return retval;
}


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

x86 assembly (clang, -O2):
<OCDBSetLibErrorStatus>:
jmp    1030 <OCDB_PGSetLibErrorStatus@plt>

LLVM IR (-O0):
%struct.sqlca_t = type { i32 }
define i32 @OCDBSetLibErrorStatus(%struct.sqlca_t* %0, i32 %1) {
%3 = alloca %struct.sqlca_t*
%4 = alloca i32
%5 = alloca i32
store %struct.sqlca_t* %0, %struct.sqlca_t** %3
store i32 %1, i32* %4
%6 = load %struct.sqlca_t*, %struct.sqlca_t** %3
%7 = load i32, i32* %4
%8 = call i32 @OCDB_PGSetLibErrorStatus(%struct.sqlca_t* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.sqlca_t = type { i32 }
define i32 @OCDBSetLibErrorStatus(%struct.sqlca_t* %0, i32 %1) {
%3 = tail call i32 @OCDB_PGSetLibErrorStatus(%struct.sqlca_t* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int ljoy_sm_WaitExtraPrecision(long, int /*<<< orphan*/);
int ljoy_sm_Wait(long timeout_s) {
  return (ljoy_sm_WaitExtraPrecision(timeout_s, 0));
}


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

x86 assembly (clang, -O2):
<ljoy_sm_Wait>:
xor    %esi,%esi
jmp    1030 <ljoy_sm_WaitExtraPrecision@plt>

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

LLVM IR (-O2):
define i32 @ljoy_sm_Wait(i64 %0) {
%2 = tail call i32 @ljoy_sm_WaitExtraPrecision(i64 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int ig_indirect_table_set(unsigned int, int, unsigned int, int, unsigned int *);
int ig_poc_lut_table_set(unsigned int dev_id, unsigned int index,
                         unsigned int *pentry) {
  if ((index < 0) || (index > 47)) {
    return -1;
  }
  return ig_indirect_table_set(dev_id, 4, index, 4, pentry);
}


x86 assembly (clang, -O0):
<ig_poc_lut_table_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <ig_poc_lut_table_set+0x26>
cmpl   $0x2f,-0xc(%rbp)
jbe    1142 <ig_poc_lut_table_set+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <ig_poc_lut_table_set+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x4,%ecx
mov    %ecx,%esi
call   1030 <ig_indirect_table_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_poc_lut_table_set>:
cmp    $0x2f,%esi
jbe    111b <ig_poc_lut_table_set+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x4,%esi
mov    $0x4,%ecx
jmp    1030 <ig_indirect_table_set@plt>

LLVM IR (-O0):
define i32 @ig_poc_lut_table_set(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 47
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @ig_indirect_table_set(i32 %15, i32 4, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ig_poc_lut_table_set(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 47
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ig_indirect_table_set(i32 %0, i32 4, i32 %1, i32 4, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ expm1(double);
long double expm1l(long double x) { return (long double)expm1((double)x); }


x86 assembly (clang, -O0):
<expm1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <expm1@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <expm1@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @expm1l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @expm1(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @expm1l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @expm1(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
const char *mg_version(void) { return "4.2"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"4.2\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void testClosureISrV(void (*closure)(int, short), int a1, short a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureISrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
movswl -0xe(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureISrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureISrV(void (i32, i16)* nocapture %0, i32 %1, i16 signext %2) {
tail call void %0(i32 %1, i16 signext %2)
ret void
}
/* Variables and functions */
scalar_t__ bar(int);
int /*<<< orphan*/ baz(int *);
int foo(int i) {
  int j;
  if (bar(i)) {
    baz(&j);
  } else {
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bar@plt>
cmp    $0x0,%rax
je     114b <foo+0x2b>
lea    -0x8(%rbp),%rdi
call   1030 <baz@plt>
jmp    1150 <foo+0x30>
jmp    1150 <foo+0x30>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1040 <bar@plt>
test   %rax,%rax
je     113b <foo+0x1b>
lea    0x4(%rsp),%rdi
call   1030 <baz@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i64 @bar(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @baz(i32* %2)
%8 = load i32, i32* %2
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ undef, %1 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_three() { printf("3"); }


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

x86 assembly (clang, -O2):
<say_three>:
mov    $0x33,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @say_three() {
%1 = tail call i32 @putchar(i32 51)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void pwd(void) {
  char cwd[1024];
  if (getcwd(cwd, sizeof(cwd)) != NULL)
    printf("%s\n", cwd);
  else
    printf("Error: getcwd();\n");
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1160 <pwd+0x40>
lea    -0x400(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <pwd+0x4e>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     113e <pwd+0x1e>
mov    %rsp,%rdi
jmp    1145 <pwd+0x25>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [18 x i8] c"Error: getcwd();\0A\00"
define void @pwd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32* @getcwd(i8* %2, i32 1024)
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Error: getcwd();\00"
define void @pwd() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32* @getcwd(i8* %2, i32 1024)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @puts(i8* %2)
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}
f(a, b, c) {
  int i = a || b && c;
  return i && b || c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    113b <f+0x3b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
je     1135 <f+0x35>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115f <f+0x5f>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x13(%rbp)
jne    1169 <f+0x69>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%al
test   %edi,%edi
jne    1112 <f+0x12>
test   %esi,%esi
setne  %cl
test   %edx,%edx
setne  %al
and    %cl,%al
test   %esi,%esi
setne  %cl
and    %al,%cl
test   %edx,%edx
setne  %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp ne i32 %1, 0
%7 = icmp ne i32 %2, 0
%8 = and i1 %6, %7
br label %9
9: ; preds = %5, %3
%10 = phi i1 [ true, %3 ], [ %8, %5 ]
%11 = icmp ne i32 %1, 0
%12 = and i1 %11, %10
%13 = icmp ne i32 %2, 0
%14 = or i1 %13, %12
%15 = zext i1 %14 to i32
ret i32 %15
}
void RTS3CreateBucket(void) {}


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

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

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

LLVM IR (-O2):
define void @RTS3CreateBucket() {
ret void
}
char lower(char c) { return 'A' <= c && c <= 'Z' ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     113a <lower+0x3a>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     113a <lower+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <lower+0x41>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  unsigned char age;
  float price;
  printf("%hhu\n", age);
  printf("%f\n", price);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movzbl -0x5(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%hhu\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
store i32 0, i32* %1
%4 = load i8, i8* %2
%5 = uitofp i8 %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%hhu\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void TEST(char *string, int exit_code) {
  fprintf(stderr, "TEST HERE: %s\n", string);
  if (exit_code == 1)
    exit(1);
}


x86 assembly (clang, -O0):
<TEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    115c <TEST+0x3c>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x1,%ebx
je     1142 <TEST+0x22>
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"TEST HERE: %s\0A\00"
define void @TEST(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"TEST HERE: %s\0A\00"
define void @TEST(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
struct ecm_front_end_connection_instance {
  int dummy;
};
struct ecm_db_connection_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
ecm_db_connection_regeneration_needed(struct ecm_db_connection_instance *);
void ecm_nss_common_connection_regenerate(
    struct ecm_front_end_connection_instance *feci,
    struct ecm_db_connection_instance *ci) {
  ecm_db_connection_regeneration_needed(ci);
}


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

x86 assembly (clang, -O2):
<ecm_nss_common_connection_regenerate>:
mov    %rsi,%rdi
jmp    1030 <ecm_db_connection_regeneration_needed@plt>

LLVM IR (-O0):
%struct.ecm_front_end_connection_instance = type { i32 }
%struct.ecm_db_connection_instance = type { i32 }
define void @ecm_nss_common_connection_regenerate(%struct.ecm_front_end_connection_instance* %0, %struct.ecm_db_connection_instance* %1) {
%3 = alloca %struct.ecm_front_end_connection_instance*
%4 = alloca %struct.ecm_db_connection_instance*
store %struct.ecm_front_end_connection_instance* %0, %struct.ecm_front_end_connection_instance** %3
store %struct.ecm_db_connection_instance* %1, %struct.ecm_db_connection_instance** %4
%5 = load %struct.ecm_db_connection_instance*, %struct.ecm_db_connection_instance** %4
%6 = call i32 @ecm_db_connection_regeneration_needed(%struct.ecm_db_connection_instance* %5)
ret void
}

LLVM IR (-O2):
%struct.ecm_front_end_connection_instance = type { i32 }
%struct.ecm_db_connection_instance = type { i32 }
define void @ecm_nss_common_connection_regenerate(%struct.ecm_front_end_connection_instance* nocapture readnone %0, %struct.ecm_db_connection_instance* %1) {
%3 = tail call i32 @ecm_db_connection_regeneration_needed(%struct.ecm_db_connection_instance* %1)
ret void
}
/* Variables and functions */
unsigned int abs_entry(int);
unsigned int abs(int i) { return abs_entry(i); }


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

x86 assembly (clang, -O2):
<abs>:
jmp    1030 <abs_entry@plt>

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @abs_entry(i32 %0)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(252, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xfc,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_target_system>:
mov    $0xfc,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 252, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 252, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_collapse_diagonal(int k, int d) {
  int a[2], *b, fail;
  double *c;
  a[0] = k;
  a[1] = d;
  fail = _ada_use_c2phc4c(299, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_collapse_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x12b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_collapse_diagonal>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x12b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dobldobl_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca i32*
%7 = alloca i32
%8 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = load i32*, i32** %6
%15 = load double*, double** %8
%16 = call i32 @_ada_use_c2phc4c(i32 299, i32* %13, i32* %14, double* %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @dobldobl_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @_ada_use_c2phc4c(i32 299, i32* %5, i32* undef, double* undef, i32 0)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ivory_serialize_unpack_prim_1_be(const uint8_t *src) {
  return ((uint8_t)src[0] << 0);
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_prim_1_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ivory_serialize_unpack_prim_1_be(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @ivory_serialize_unpack_prim_1_be(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int os_is_setuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_is_setuid() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void cpu_to_le32wu(uint32_t *p, uint32_t v) {
  uint8_t *p1 = (uint8_t *)p;
  p1[0] = v;
  p1[1] = v >> 8;
  p1[2] = v >> 16;
  p1[3] = v >> 24;
}


x86 assembly (clang, -O0):
<cpu_to_le32wu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_le32wu>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @cpu_to_le32wu(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
%18 = load i32, i32* %4
%19 = ashr i32 %18, 24
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 3
store i32 %19, i32* %21
ret void
}

LLVM IR (-O2):
define void @cpu_to_le32wu(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
void *checkedMalloc(size_t);
void *sortedTableTreeMalloc(struct libavl_allocator *allocator, size_t size) {
  return checkedMalloc(size);
}


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

x86 assembly (clang, -O2):
<sortedTableTreeMalloc>:
mov    %rsi,%rdi
jmp    1030 <checkedMalloc@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @sortedTableTreeMalloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @checkedMalloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define i8* @sortedTableTreeMalloc(%struct.libavl_allocator* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @checkedMalloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ WindVelocityActualHandle();
void WindVelocityActualRequestUpdate() {
  UAVObjRequestUpdate(WindVelocityActualHandle());
}


x86 assembly (clang, -O0):
<WindVelocityActualRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WindVelocityActualHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WindVelocityActualRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <WindVelocityActualHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @WindVelocityActualRequestUpdate() {
%1 = call i32 (...) @WindVelocityActualHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WindVelocityActualRequestUpdate() {
%1 = tail call i32 (...) @WindVelocityActualHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: %s <dst> <new> <contents> <...>\n", getprogname());
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s <dst> <new> <contents> <...>\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EX_USAGE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s <dst> <new> <contents> <...>\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EX_USAGE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int gdt_compare_uint(const void *p1, const void *p2) {
  unsigned int n1 = *((unsigned int *)p1);
  unsigned int n2 = *((unsigned int *)p2);
  if (n1 < n2) {
    return -1;
  } else if (n1 > n2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <gdt_compare_uint+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <gdt_compare_uint+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    114e <gdt_compare_uint+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <gdt_compare_uint+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_uint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gdt_compare_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int floor_log2(int n) {
  int r = 0;
  while ((n >>= 1))
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<floor_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <floor_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <floor_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <floor_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <floor_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @floor_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct hededg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_hededg(struct hededg *edg) { free_object(61, (short *)edg); }


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

x86 assembly (clang, -O2):
<free_hededg>:
mov    %rdi,%rsi
mov    $0x3d,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.hededg = type { i32 }
define void @free_hededg(%struct.hededg* %0) {
%2 = alloca %struct.hededg*
store %struct.hededg* %0, %struct.hededg** %2
%3 = load %struct.hededg*, %struct.hededg** %2
%4 = bitcast %struct.hededg* %3 to i16*
%5 = call i32 @free_object(i32 61, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.hededg = type { i32 }
define void @free_hededg(%struct.hededg* %0) {
%2 = bitcast %struct.hededg* %0 to i16*
%3 = tail call i32 @free_object(i32 61, i16* %2)
ret void
}
void _libxpc_initializer(void) {}


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

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

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

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

/* Variables and functions */
int __allow(int /*<<< orphan*/, int /*<<< orphan*/, void *, size_t);
int allow(uint32_t driver, uint32_t allow, void *ptr, size_t size) {
  return __allow(driver, allow, ptr, size);
}


x86 assembly (clang, -O0):
<allow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <__allow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allow>:
jmp    1030 <__allow@plt>

LLVM IR (-O0):
define i32 @allow(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @__allow(i32 %9, i32 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @allow(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @__allow(i32 %0, i32 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
unsigned int rotr1(unsigned int a) {
  unsigned int b;
  if ((a & 0x01) == 0x01) {
    b = (a >> 1) | 0x8000;
  } else {
    b = (a >> 1) & 0x7fff;
  }
  b = b % 65536;
  return b;
}


x86 assembly (clang, -O0):
<rotr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1129 <rotr1+0x29>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     $0x8000,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <rotr1+0x37>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0x7fff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr1>:
mov    %edi,%eax
shr    %eax
mov    %eax,%ecx
or     $0x8000,%ecx
and    $0x7fff,%eax
test   $0x1,%dil
cmovne %ecx,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @rotr1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = lshr i32 %8, 1
%10 = or i32 %9, 32768
store i32 %10, i32* %3
br label %15
11: ; preds = %1
%12 = load i32, i32* %2
%13 = lshr i32 %12, 1
%14 = and i32 %13, 32767
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %7
%16 = load i32, i32* %3
%17 = urem i32 %16, 65536
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @rotr1(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = lshr i32 %0, 1
%5 = or i32 %4, 32768
%6 = and i32 %4, 32767
%7 = select i1 %3, i32 %6, i32 %5
%8 = and i32 %7, 65535
ret i32 %8
}
void nmea_wr_posn_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @nmea_wr_posn_deinit() {
ret void
}
/* Variables and functions */
scalar_t__ medusaDataReadyTimed(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ writeError(int, char *, int);
int medusaCheckSocket(int socket, int usec) {
  writeError(7, "Socket Check - wait time: %d", usec);
  if (medusaDataReadyTimed(socket, 0, usec) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<medusaCheckSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x7,%edi
lea    0xec3(%rip),%rsi
call   1040 <writeError@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <medusaDataReadyTimed@plt>
cmp    $0x0,%rax
jne    1165 <medusaCheckSocket+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <medusaCheckSocket+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaCheckSocket>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rsi
mov    $0x7,%edi
mov    %ebx,%edx
call   1040 <writeError@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <medusaDataReadyTimed@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Socket Check - wait time: %d\00"
define i32 @medusaCheckSocket(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @writeError(i32 7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i64 @medusaDataReadyTimed(i32 %8, i32 0, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"Socket Check - wait time: %d\00"
define i32 @medusaCheckSocket(i32 %0, i32 %1) {
%3 = tail call i32 @writeError(i32 7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i64 @medusaDataReadyTimed(i32 %0, i32 0, i32 %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void RTVfsIoStrmRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmRead() {
ret void
}
unsigned long long sub1(unsigned long long x, unsigned n) { return x - n; }


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
mov    %rdi,%rax
mov    %esi,%ecx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sub1(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = sub i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @sub1(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = sub i64 %0, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int suma, a;
  suma = 0;
  for (a = 11; a <= 50; a++) {
    suma = suma + a;
  }
  printf("suma liczb od 11 do 50=%d\n", suma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xb,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"suma liczb od 11 do 50=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1220)
ret i32 0
}
int real_clk(int bus, int br) { return bus / (2 << br); }


x86 assembly (clang, -O0):
<real_clk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x2,%edx
shl    %cl,%edx
mov    %edx,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_clk>:
mov    %esi,%ecx
mov    $0x2,%esi
shl    %cl,%esi
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @real_clk(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 2, %6
%8 = sdiv i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @real_clk(i32 %0, i32 %1) {
%3 = shl nuw i32 2, %1
%4 = sdiv i32 %0, %3
ret i32 %4
}