xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t;
  char *str;
  t = time(NULL);
  str = ctime(&t);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int is_multiple_char(char c) {
  return (c == '*' || c == '+' || c == '?' || c == '{');
}


x86 assembly (clang, -O0):
<is_multiple_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_multiple_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_multiple_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3f,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_multiple_char+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x7b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiple_char>:
cmp    $0x3f,%dil
ja     1120 <is_multiple_char+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x80000c0000000000,%rdx
bt     %rcx,%rdx
jae    1120 <is_multiple_char+0x20>
ret
xor    %eax,%eax
cmp    $0x7b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_multiple_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 42
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 63
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 123
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_multiple_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 63, label %5
i8 43, label %5
i8 42, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 123
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void caller_2_2_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_2_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ playsound(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ say_xy(char *, int /*<<< orphan*/, int);
void talk(void) {
  say_xy("wscream.wav/5512Hz - Lyna's Story - DDC ressurect", 0, 380);
  playsound(12, 5512, 0, 0, 0);
}


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1030 <say_xy@plt>
mov    $0xc,%edi
mov    $0x1588,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <playsound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1030 <say_xy@plt>
mov    $0xc,%edi
mov    $0x1588,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rax
jmp    1040 <playsound@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"wscream.wav/5512Hz - Lyna's Story - DDC ressurect\00"
define void @talk() {
%1 = call i32 @say_xy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 0, i32 380)
%2 = call i32 @playsound(i32 12, i32 5512, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"wscream.wav/5512Hz - Lyna's Story - DDC ressurect\00"
define void @talk() {
%1 = tail call i32 @say_xy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 0, i32 380)
%2 = tail call i32 @playsound(i32 12, i32 5512, i32 0, i32 0, i32 0)
ret void
}
int increaseMult(int currentMultiplier, int AmountToAdd) {
  if (currentMultiplier < 20)
    return (currentMultiplier + AmountToAdd);
  else
    return currentMultiplier;
}


x86 assembly (clang, -O0):
<increaseMult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1122 <increaseMult+0x22>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <increaseMult+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increaseMult>:
xor    %eax,%eax
cmp    $0x14,%edi
cmovl  %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @increaseMult(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* %4
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @increaseMult(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 20
%4 = select i1 %3, i32 %1, i32 0
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ out_print(char *);
int com_exit() {
  out_print("\n");
  return -1;
}


x86 assembly (clang, -O0):
<com_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <out_print@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_exit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <out_print@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @com_exit() {
%1 = tail call i32 @out_print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_div(int a, int b) {
  ft_putnbr(a / b);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_div>:
push   %rax
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_div(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 = sdiv i32 %5, %6
%8 = call i32 @ft_putnbr(i32 %7)
%9 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @ft_putnbr(i32 %3)
%5 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
void P(sid) int sid;
{
  semcall(sid, -1);
  return;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <semcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <semcall@plt>

LLVM IR (-O0):
define void @P(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, ...)*)(i32 %3, i32 -1)
ret void
}

LLVM IR (-O2):
define void @P(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, ...)*)(i32 %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__37__IO__makeOutput();
void SharedAnalogDeviceP__0__EnablePin__makeOutput(void) {
  HplAtm128GeneralIOPinP__37__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @SharedAnalogDeviceP__0__EnablePin__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__37__IO__makeOutput()
ret void
}
int sum(int a, int b) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
ret i32 1
}
/* Type definitions */
struct work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct work *);
void witem_free(struct work *wi) { free(wi); }


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

x86 assembly (clang, -O2):
<witem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.work = type { i32 }
define void @witem_free(%struct.work* nocapture %0) {
%2 = tail call i32 @free(%struct.work* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void init(void) {
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @init() {
%1 = load i32, i32* @GL_LIGHTING
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = call i32 @glEnable(i32 %3)
ret void
}

LLVM IR (-O2):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @init() {
%1 = load i32, i32* @GL_LIGHTING
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = tail call i32 @glEnable(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert_add_test();
void test_assert_add_test_constructor(void) { test_assert_add_test(); }


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

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

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

LLVM IR (-O2):
define void @test_assert_add_test_constructor() {
%1 = tail call i32 (...) @test_assert_add_test()
ret void
}
int getAbsoValue(int a) {
  if (a < 0)
    return a * (-1);
  else
    return a;
}


x86 assembly (clang, -O0):
<getAbsoValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <getAbsoValue+0x1d>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <getAbsoValue+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAbsoValue>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getAbsoValue(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ remove(char const *);
int32_t fslittle_test_delete(const char *filename) {
  do {
  } while (0);
  return remove(filename);
}


x86 assembly (clang, -O0):
<fslittle_test_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <fslittle_test_delete+0x11>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fslittle_test_delete>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
define i32 @fslittle_test_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i8*, i8** %2
%6 = call i32 @remove(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @fslittle_test_delete(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
char *strcat(char *dest, const char *src) {
  char *cp = dest;
  while (*cp) {
    cp++;
  }
  while ((*cp++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_GetBaseAddress(int fh) { return ioctl(fh, _IO(0xce, 15)); }


x86 assembly (clang, -O0):
<CED_GetBaseAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_GetBaseAddress>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_GetBaseAddress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 15)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_GetBaseAddress(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 15)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
int UAX_Asm_RegIsExtByteP(int reg) {
  if (((reg & 0xF0) == 0x30) && ((reg & 0x0F) >= 4))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<UAX_Asm_RegIsExtByteP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    1133 <UAX_Asm_RegIsExtByteP+0x33>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
cmp    $0x4,%eax
jl     1133 <UAX_Asm_RegIsExtByteP+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <UAX_Asm_RegIsExtByteP+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UAX_Asm_RegIsExtByteP>:
mov    %edi,%eax
and    $0xf0,%eax
cmp    $0x30,%eax
sete   %al
test   $0xc,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @UAX_Asm_RegIsExtByteP(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp eq i32 %2, 48
%4 = and i32 %0, 12
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int main() {
  char mapping[10][6] = {"zero", "one", "two",   "three", "four",
                         "five", "six", "seven", "eight", "nine"};
  int a;
  scanf("%d", &a);
  printf("%s\n", mapping[a]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
lea    0xee8(%rip),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movslq -0x44(%rbp),%rax
lea    -0x40(%rbp),%rsi
imul   $0x6,%rax,%rax
add    %rax,%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xee1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,2),%rdi
add    $0x10,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.mapping = [10 x [6 x i8]] [[6 x i8] c"zero\00\00", [6 x i8] c"one\00\00\00", [6 x i8] c"two\00\00\00", [6 x i8] c"three\00", [6 x i8] c"four\00\00", [6 x i8] c"five\00\00", [6 x i8] c"six\00\00\00", [6 x i8] c"seven\00", [6 x i8] c"eight\00", [6 x i8] c"nine\00\00"]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x [6 x i8]]
%2 = alloca i32
%3 = bitcast [10 x [6 x i8]]* %1 to i8*
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %1, i64 0, i64 %6
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mapping = [10 x [6 x i8]] [[6 x i8] c"zero\00\00", [6 x i8] c"one\00\00\00", [6 x i8] c"two\00\00\00", [6 x i8] c"three\00", [6 x i8] c"four\00\00", [6 x i8] c"five\00\00", [6 x i8] c"six\00\00\00", [6 x i8] c"seven\00", [6 x i8] c"eight\00", [6 x i8] c"nine\00\00"]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x [6 x i8]]
%2 = alloca i32
%3 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %1, i64 0, i64 %7, i64 0
%9 = call i32 @puts(i8* %8)
ret i32 0
}
void __DELETE_java_lang_Long_valueOfCache(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Long_valueOfCache(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void UART2_RX_intr(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
bool isRunning(pid_t p) {
  if (!kill(p, 0))
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<isRunning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0x0,%eax
jne    113a <isRunning+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <isRunning+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRunning>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isRunning(i32 %0) {
%2 = tail call i32 @kill(i32 %0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void Athena_MillisecondSleep(unsigned ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<Athena_MillisecondSleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @Athena_MillisecondSleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @Athena_MillisecondSleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int ft_tolower(int c) {
  if (c > 64 && c < 91)
    return (c + 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jle    1129 <ft_tolower+0x29>
cmpl   $0x5b,-0x8(%rbp)
jge    1129 <ft_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
float bam_aux2f(const unsigned char *s) {
  int type = *s++;
  if (s == 0)
    return 0.0;
  if (type == 'f')
    return *(float *)s;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<bam_aux2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <bam_aux2f+0x35>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1159 <bam_aux2f+0x59>
cmpl   $0x66,-0x14(%rbp)
jne    1151 <bam_aux2f+0x51>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1159 <bam_aux2f+0x59>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_aux2f>:
xorps  %xmm0,%xmm0
cmpb   $0x66,(%rdi)
jne    110d <bam_aux2f+0xd>
movss  0x1(%rdi),%xmm0
ret

LLVM IR (-O0):
define float @bam_aux2f(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %3
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store float 0.000000e+00, float* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 102
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to float*
%18 = load float, float* %17
store float %18, float* %2
br label %20
19: ; preds = %12
store float 0.000000e+00, float* %2
br label %20
20: ; preds = %19, %15, %11
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @bam_aux2f(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 102
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
br label %8
8: ; preds = %1, %4
%9 = phi float [ %7, %4 ], [ 0.000000e+00, %1 ]
ret float %9
}
int val(int d) { return '\0'; }


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

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

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

LLVM IR (-O2):
define i32 @val(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_run() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_run"
         "\n");
}


x86 assembly (clang, -O0):
<pa_mainloop_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_mainloop_run\00"
define i32 @pa_mainloop_run() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int nums[] = {1, 2, 3};
  printf("nums  is at %p\n", nums);
  printf("nums + 1 is at %p\n", nums + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xedb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [16 x i8] c"nums is at %p\0A\00"
@.str.1 = [19 x i8] c"nums + 1 is at %p\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %5)
ret i32 0
}
void trm_word() {}


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

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

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

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

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_type(void *m, uint8_t *type) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_message_get_type>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_type(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_type(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int RTLD_LOCAL;
int RTLD_NOW;
int /*<<< orphan*/ dlclose(void *);
void *dlopen(char *, int);
int main() {
  void *h;
  h = dlopen("__nothing_rdkafka.so", RTLD_NOW | RTLD_LOCAL);
  if (h)
    dlclose(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <main+0x45>
mov    -0x10(%rbp),%rdi
call   1040 <dlclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <dlopen@plt>
test   %rax,%rax
je     114c <main+0x2c>
mov    %rax,%rdi
call   1040 <dlclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"__nothing_rdkafka.so\00"
@RTLD_NOW = global i32 0
@RTLD_LOCAL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i32, i32* @RTLD_NOW
%4 = load i32, i32* @RTLD_LOCAL
%5 = or i32 %3, %4
%6 = call i8* @dlopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = call i32 @dlclose(i8* %10)
br label %12
12: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"__nothing_rdkafka.so\00"
@RTLD_NOW = global i32 0
@RTLD_LOCAL = global i32 0
define i32 @main() {
%1 = load i32, i32* @RTLD_NOW
%2 = load i32, i32* @RTLD_LOCAL
%3 = or i32 %2, %1
%4 = tail call i8* @dlopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @dlclose(i8* %4)
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
void *_strdup(char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
char *xstrdup(const char *s) {
  if (!s) {
    puts("Failed: "
         "xstrdup");
    exit(-1);
  }
  void *p = _strdup(s);
  if (!p) {
    puts("Failed: "
         "xstrdup");
    exit(-1);
  }
  return (char *)p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <xstrdup+0x2d>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118b <xstrdup+0x5b>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     1142 <xstrdup+0x12>
call   1050 <_strdup@plt>
test   %rax,%rax
je     1142 <xstrdup+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Failed: xstrdup\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i8* @_strdup(i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [16 x i8] c"Failed: xstrdup\00"
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
%7 = tail call i8* @_strdup(i8* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ zipRawEntryLength(unsigned char *);
unsigned char *ziplistNext(unsigned char *zl, unsigned char *p) {
  ((void)zl);
  if (p[0] == 255) {
    return NULL;
  }
  p += zipRawEntryLength(p);
  if (p[0] == 255) {
    return NULL;
  }
  return p;
}


x86 assembly (clang, -O0):
<ziplistNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
jne    113f <ziplistNext+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    117f <ziplistNext+0x6f>
mov    -0x18(%rbp),%rdi
call   1030 <zipRawEntryLength@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
jne    1177 <ziplistNext+0x67>
movq   $0x0,-0x8(%rbp)
jmp    117f <ziplistNext+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziplistNext>:
push   %rbx
cmpb   $0xff,(%rsi)
je     1134 <ziplistNext+0x24>
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <zipRawEntryLength@plt>
movslq %eax,%rcx
lea    (%rbx,%rcx,1),%rdx
xor    %eax,%eax
cmpb   $0xff,(%rbx,%rcx,1)
cmovne %rdx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ziplistNext(i8* nocapture readnone %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, -1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @zipRawEntryLength(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, -1
%11 = select i1 %10, i8* null, i8* %8
br label %12
12: ; preds = %5, %2
%13 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %13
}
int musbgm_getlen(int no) {
  printf("%s not implemented\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<musbgm_getlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_getlen = [14 x i8] c"musbgm_getlen\00"
define i32 @musbgm_getlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.musbgm_getlen, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_getlen = [14 x i8] c"musbgm_getlen\00"
define i32 @musbgm_getlen(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.musbgm_getlen, i64 0, i64 0))
ret i32 0
}
void rte_wmb(void) {}


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

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

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

LLVM IR (-O2):
define void @rte_wmb() {
ret void
}
int opt_g_d_fnamei(void *arg, int m, void *opt) { return 9910; }


x86 assembly (clang, -O0):
<opt_g_d_fnamei>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x26b6,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @opt_g_d_fnamei(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 9910
}
/* Variables and functions */
int isAlive();
int STEAMSHIM_alive(void) { return isAlive(); }


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

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

LLVM IR (-O0):
define i32 @STEAMSHIM_alive() {
%1 = call i32 (...) @isAlive()
ret i32 %1
}

LLVM IR (-O2):
define i32 @STEAMSHIM_alive() {
%1 = tail call i32 (...) @isAlive()
ret i32 %1
}
void SVC_Handler(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @SVC_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
void swap(int *array, int a, int b) {
  int val = array[a];
  array[a] = array[b];
  array[b] = val;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int getGameGenieLen();
int isInvalidInput() {
  if (getGameGenieLen() < 6)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isInvalidInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getGameGenieLen@plt>
cmp    $0x6,%eax
jge    1134 <isInvalidInput+0x24>
movl   $0x1,-0x4(%rbp)
jmp    113b <isInvalidInput+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInvalidInput>:
push   %rax
xor    %eax,%eax
call   1030 <getGameGenieLen@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isInvalidInput() {
%1 = alloca i32
%2 = call i32 (...) @getGameGenieLen()
%3 = icmp slt i32 %2, 6
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @isInvalidInput() {
%1 = tail call i32 (...) @getGameGenieLen()
%2 = icmp slt i32 %1, 6
%3 = zext i1 %2 to i32
ret i32 %3
}
void TestDynamicLoaderImplSymbolPointer() {}


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

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

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

LLVM IR (-O2):
define void @TestDynamicLoaderImplSymbolPointer() {
ret void
}
/* Variables and functions */
int isdigit(const char c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}