xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ permutation(char *, int /*<<< orphan*/, int);
int strlen(char *);
int main() {
  char name[] = "9788029400";
  int len = strlen(name);
  permutation(name, 0, len - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
lea    -0xb(%rbp),%rdi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x3439323038383739,%rax
32 39 34
mov    %rax,(%rsp)
movl   $0x303034,0x7(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.name = [11 x i8] c"9788029400\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca i32
%3 = bitcast [11 x i8]* %1 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @permutation(i8* %6, i32 0, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [11 x i8] c"9788029400\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = call i32 @permutation(i8* %2, i32 0, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ S6D2101_EightColorMode();
int /*<<< orphan*/ S6D2101_InternalMode();
int /*<<< orphan*/ WriteLDI_LTE246(int, unsigned char);
void S6D2101_WindowScreenInternalEightColorMode(unsigned char hsa,
                                                unsigned char hea) {
  unsigned int addr = 0x0000;
  S6D2101_InternalMode();
  WriteLDI_LTE246(0x20, addr & 0xff);
  WriteLDI_LTE246(0x21, 0x0000);
  WriteLDI_LTE246(0x44, (hea << 8) | hsa);
  S6D2101_EightColorMode();
}


x86 assembly (clang, -O0):
<S6D2101_WindowScreenInternalEightColorMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <S6D2101_InternalMode@plt>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    $0x20,%edi
movzbl %al,%esi
call   1040 <WriteLDI_LTE246@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <WriteLDI_LTE246@plt>
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    $0x44,%edi
movzbl %al,%esi
call   1040 <WriteLDI_LTE246@plt>
mov    $0x0,%al
call   1030 <S6D2101_EightColorMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S6D2101_WindowScreenInternalEightColorMode>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <S6D2101_InternalMode@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1040 <WriteLDI_LTE246@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <WriteLDI_LTE246@plt>
mov    $0x44,%edi
mov    %ebx,%esi
call   1040 <WriteLDI_LTE246@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <S6D2101_EightColorMode@plt>

LLVM IR (-O0):
define void @S6D2101_WindowScreenInternalEightColorMode(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = call i32 (...) @S6D2101_InternalMode()
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = call i32 @WriteLDI_LTE246(i32 32, i8 zeroext %9)
%11 = call i32 @WriteLDI_LTE246(i32 33, i8 zeroext 0)
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
%18 = trunc i32 %17 to i8
%19 = call i32 @WriteLDI_LTE246(i32 68, i8 zeroext %18)
%20 = call i32 (...) @S6D2101_EightColorMode()
ret void
}

LLVM IR (-O2):
define void @S6D2101_WindowScreenInternalEightColorMode(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @S6D2101_InternalMode()
%4 = tail call i32 @WriteLDI_LTE246(i32 32, i8 zeroext 0)
%5 = tail call i32 @WriteLDI_LTE246(i32 33, i8 zeroext 0)
%6 = tail call i32 @WriteLDI_LTE246(i32 68, i8 zeroext %0)
%7 = tail call i32 (...) @S6D2101_EightColorMode()
ret void
}
int isLessOrEqual(int x, int y) {
  return ((x + ~(((x ^ y) >> 31) | y)) >> 31) & 1;
}


x86 assembly (clang, -O0):
<isLessOrEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
or     -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
sar    $0x1f,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLessOrEqual>:
mov    %esi,%eax
xor    %edi,%eax
sar    $0x1f,%eax
or     %esi,%eax
not    %eax
add    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @isLessOrEqual(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = ashr i32 %8, 31
%10 = load i32, i32* %4
%11 = or i32 %9, %10
%12 = xor i32 %11, -1
%13 = add nsw i32 %5, %12
%14 = ashr i32 %13, 31
%15 = and i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @isLessOrEqual(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = ashr i32 %3, 31
%5 = or i32 %4, %1
%6 = xor i32 %5, -1
%7 = add nsw i32 %6, %0
%8 = lshr i32 %7, 31
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ check_intInput(int *, int *);
int destroy_nth_position_bit(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Enter decimal and bit position: ");
  int n, position;
  check_intInput(&n, &position);
  int destroedBit = destroy_nth_position_bit(n, position);
  printf("new number: %d", destroedBit);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <check_intInput@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <destroy_nth_position_bit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"Enter decimal and bit position: \00"
@.str.1 = [15 x i8] c"new number: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @check_intInput(i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @destroy_nth_position_bit(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter decimal and bit position: \00"
@.str.1 = [15 x i8] c"new number: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @check_intInput(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @destroy_nth_position_bit(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dmaCompleteUsbCh0Out();
void INT_D0FIFO1_COMPLETE(void) { dmaCompleteUsbCh0Out(); }


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

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

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

LLVM IR (-O2):
define void @INT_D0FIFO1_COMPLETE() {
%1 = tail call i32 (...) @dmaCompleteUsbCh0Out()
ret void
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void nonbeacon_device() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x00);
  temp = temp & 0xF3;
  write_ZIGBEE_short(0x00, temp);
  temp = read_ZIGBEE_short(0x11);
  temp = temp & 0xDF;
  write_ZIGBEE_short(0x11, temp);
}


x86 assembly (clang, -O0):
<nonbeacon_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
xor    %edi,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0xf3,%eax
mov    %ax,-0x2(%rbp)
xor    %edi,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
mov    $0x11,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0xdf,%eax
mov    %ax,-0x2(%rbp)
mov    $0x11,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonbeacon_device>:
push   %rax
xor    %edi,%edi
call   1030 <read_ZIGBEE_short@plt>
and    $0xf3,%eax
xor    %edi,%edi
mov    %eax,%esi
call   1040 <write_ZIGBEE_short@plt>
mov    $0x11,%edi
call   1030 <read_ZIGBEE_short@plt>
and    $0xdf,%eax
mov    $0x11,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @nonbeacon_device() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 0)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = and i32 %4, 243
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 0, i16 signext %7)
%9 = call signext i16 @read_ZIGBEE_short(i32 17)
store i16 %9, i16* %1
%10 = load i16, i16* %1
%11 = sext i16 %10 to i32
%12 = and i32 %11, 223
%13 = trunc i32 %12 to i16
store i16 %13, i16* %1
%14 = load i16, i16* %1
%15 = call i32 @write_ZIGBEE_short(i32 17, i16 signext %14)
ret void
}

LLVM IR (-O2):
define void @nonbeacon_device() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 0)
%2 = and i16 %1, 243
%3 = tail call i32 @write_ZIGBEE_short(i32 0, i16 signext %2)
%4 = tail call signext i16 @read_ZIGBEE_short(i32 17)
%5 = and i16 %4, 223
%6 = tail call i32 @write_ZIGBEE_short(i32 17, i16 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COM_StrAfter(char const *, char *, char const **);
char *COM_StrBefore(char const *, char *, char const **);
void COM_Split(const char *text, const char *delimiter, const char **outBefore,
               const char **outAfter) {
  const char *data = COM_StrBefore(text, "=", outBefore);
  COM_StrAfter(data, "=", outAfter);
}


x86 assembly (clang, -O0):
<COM_Split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeb9(%rip),%rsi
call   1030 <COM_StrBefore@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1040 <COM_StrAfter@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_Split>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rsi
call   1030 <COM_StrBefore@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <COM_StrAfter@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @COM_Split(i8* %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8*, i8** %5
%11 = load i8**, i8*** %7
%12 = call i8* @COM_StrBefore(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i8**, i8*** %8
%15 = call i32 @COM_StrAfter(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @COM_Split(i8* %0, i8* nocapture readnone %1, i8** %2, i8** %3) {
%5 = tail call i8* @COM_StrBefore(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = tail call i32 @COM_StrAfter(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}
void yaml_get_version(int *major, int *minor, int *patch) {
  *major = 0;
  *minor = 1;
  *patch = 7;
}


x86 assembly (clang, -O0):
<yaml_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaml_get_version>:
movl   $0x0,(%rdi)
movl   $0x1,(%rsi)
movl   $0x7,(%rdx)
ret

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

LLVM IR (-O2):
define void @yaml_get_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 1, i32* %1
store i32 7, i32* %2
ret void
}
/* Variables and functions */
char const *const *format_list();
const char *const *xmp_get_format_list(void) { return format_list(); }


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

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

LLVM IR (-O0):
define i8** @xmp_get_format_list() {
%1 = call i8** (...) @format_list()
ret i8** %1
}

LLVM IR (-O2):
define i8** @xmp_get_format_list() {
%1 = tail call i8** (...) @format_list()
ret i8** %1
}
/* Variables and functions */
int /*<<< orphan*/ ExitOn(char *);
void BrokenPipe(int sig) { ExitOn("Got SIGPIPE signal"); }


x86 assembly (clang, -O0):
<BrokenPipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <ExitOn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Got SIGPIPE signal\00"
define void @BrokenPipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ExitOn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Got SIGPIPE signal\00"
define void @BrokenPipe(i32 %0) {
%2 = tail call i32 @ExitOn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffsfs_DoUnlink_reldir(struct yaffs_obj *, char const *,
                            int /*<<< orphan*/);
int yaffs_unlink_reldir(struct yaffs_obj *reldir, const char *path) {
  return yaffsfs_DoUnlink_reldir(reldir, path, 0);
}


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

x86 assembly (clang, -O2):
<yaffs_unlink_reldir>:
xor    %edx,%edx
jmp    1030 <yaffsfs_DoUnlink_reldir@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_unlink_reldir(%struct.yaffs_obj* %0, i8* %1) {
%3 = alloca %struct.yaffs_obj*
%4 = alloca i8*
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %3
store i8* %1, i8** %4
%5 = load %struct.yaffs_obj*, %struct.yaffs_obj** %3
%6 = load i8*, i8** %4
%7 = call i32 @yaffsfs_DoUnlink_reldir(%struct.yaffs_obj* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_unlink_reldir(%struct.yaffs_obj* %0, i8* %1) {
%3 = tail call i32 @yaffsfs_DoUnlink_reldir(%struct.yaffs_obj* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ err_fini();
int /*<<< orphan*/ raise(int);
void err_general_sighandler(int signo) {
  err_fini();
  raise(signo);
}


x86 assembly (clang, -O0):
<err_general_sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <err_fini@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_general_sighandler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <err_fini@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
define void @err_general_sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @err_fini()
%4 = load i32, i32* %2
%5 = call i32 @raise(i32 %4)
ret void
}

LLVM IR (-O2):
define void @err_general_sighandler(i32 %0) {
%2 = tail call i32 (...) @err_fini()
%3 = tail call i32 @raise(i32 %0)
ret void
}
/* Variables and functions */
int nDigits(int);
int shift_num(int num) {
  switch (nDigits(num)) {
  case 0:
    return 0;
    break;
  case 1:
    return 2;
    break;
  case 2:
    return 2;
    break;
  case 3:
    return 1;
    break;
  case 4:
    return 1;
    break;
  case 5:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<shift_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nDigits@plt>
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1189 <shift_num+0x79>
mov    -0x10(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1189 <shift_num+0x79>
movl   $0x2,-0x4(%rbp)
jmp    1189 <shift_num+0x79>
movl   $0x2,-0x4(%rbp)
jmp    1189 <shift_num+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1189 <shift_num+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1189 <shift_num+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_num>:
push   %rax
call   1030 <nDigits@plt>
add    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
ja     112c <shift_num+0x1c>
cltq
lea    0xed7(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shift_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @nDigits(i32 %4)
switch i32 %5, label %12 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
]
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
store i32 2, i32* %2
br label %12
8: ; preds = %1
store i32 2, i32* %2
br label %12
9: ; preds = %1
store i32 1, i32* %2
br label %12
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %6, %7, %8, %9, %10, %11, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.shift_num = [4 x i32] [i32 2, i32 2, i32 1, i32 1]
define i32 @shift_num(i32 %0) {
%2 = tail call i32 @nDigits(i32 %0)
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 4
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.shift_num, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ txtfree(void *);
void txtunload(const char *path, void *txt, void *_info) { txtfree(txt); }


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

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

LLVM IR (-O0):
define void @txtunload(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @txtfree(i8* %7)
ret void
}

LLVM IR (-O2):
define void @txtunload(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @txtfree(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_RWLOCK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_assert(int);
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) {
  OPENSSL_assert(*(unsigned int *)lock == 1);
  return 1;
}


x86 assembly (clang, -O0):
<CRYPTO_THREAD_write_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <OPENSSL_assert@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_THREAD_write_lock>:
push   %rax
xor    %eax,%eax
cmpl   $0x1,(%rdi)
sete   %al
mov    %eax,%edi
call   1030 <OPENSSL_assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CRYPTO_THREAD_write_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @OPENSSL_assert(i32 %6)
ret i32 1
}

LLVM IR (-O2):
define i32 @CRYPTO_THREAD_write_lock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @OPENSSL_assert(i32 %4)
ret i32 1
}
int SNDDummyChangeVideoFormat(__attribute((unused)) int vertfreq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SNDDummyChangeVideoFormat(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void errExit(char *errMsg) {
  int errorno = errno;
  printf("Exiting on error:\t%s\n", errMsg);
  printf("\n\nThe errno was %i\n", errorno);
  fflush(stdout);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errExit>:
push   %rbx
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%ebx
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [22 x i8] c"Exiting on error:\09%s\0A\00"
@.str.1 = [20 x i8] c"\0A\0AThe errno was %i\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @errExit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [22 x i8] c"Exiting on error:\09%s\0A\00"
@.str.1 = [20 x i8] c"\0A\0AThe errno was %i\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @errExit(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ endSPI(int);
int /*<<< orphan*/ startSPI(int);
int /*<<< orphan*/ writeSPI(int, int);
void toSQI() {
  startSPI(1);
  writeSPI(0x00000038, 8);
  endSPI(1);
}


x86 assembly (clang, -O0):
<toSQI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <startSPI@plt>
mov    $0x38,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x1,%edi
call   1050 <endSPI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<toSQI>:
push   %rax
mov    $0x1,%edi
call   1040 <startSPI@plt>
mov    $0x38,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <endSPI@plt>

LLVM IR (-O0):
define void @toSQI() {
%1 = call i32 @startSPI(i32 1)
%2 = call i32 @writeSPI(i32 56, i32 8)
%3 = call i32 @endSPI(i32 1)
ret void
}

LLVM IR (-O2):
define void @toSQI() {
%1 = tail call i32 @startSPI(i32 1)
%2 = tail call i32 @writeSPI(i32 56, i32 8)
%3 = tail call i32 @endSPI(i32 1)
ret void
}
/* Variables and functions */
int NHanoiMoves(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int steps = NHanoiMoves(3);
  printf("%d\n", steps);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <NHanoiMoves@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @NHanoiMoves(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
size_t gcd(size_t m, size_t n) {
  if (m == 0 && n == 0)
    return 0;
  size_t r;
  while (n) {
    r = m % n;
    m = n;
    n = r;
  }
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112f <gcd+0x2f>
cmpq   $0x0,-0x18(%rbp)
jne    112f <gcd+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    116c <gcd+0x6c>
jmp    1134 <gcd+0x34>
cmpq   $0x0,-0x18(%rbp)
je     1164 <gcd+0x64>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <gcd+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rcx
or     %rdi,%rcx
je     1146 <gcd+0x46>
mov    %rsi,%rdx
mov    %rdi,%rax
test   %rsi,%rsi
jne    112d <gcd+0x2d>
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = or i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = icmp eq i64 %1, 0
br i1 %6, label %12, label %7
7: ; preds = %5, %7
%8 = phi i64 [ %10, %7 ], [ %1, %5 ]
%9 = phi i64 [ %8, %7 ], [ %0, %5 ]
%10 = urem i64 %9, %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %5, %2
%13 = phi i64 [ 0, %2 ], [ %0, %5 ], [ %8, %7 ]
ret i64 %13
}
int system_core_count(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @system_core_count() {
ret i32 8
}

LLVM IR (-O2):
define i32 @system_core_count() {
ret i32 8
}
int test_imm_F7int32_reg(int val) { return ((val) & (0xF7 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_F7int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F7int32_reg>:
test   $0xf7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F7int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 247
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_F7int32_reg(i32 %0) {
%2 = and i32 %0, 247
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int omg_dns_version_patch(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omg_dns_version_patch() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int i;
  {
    hash(1);
    hash(0);
  };
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <hash@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 @hash(i32 1)
%3 = call i32 @hash(i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 1)
%2 = tail call i32 @hash(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_22_recursive(double *, int);
void helper_double_22(double *buf) { helper_double_22_recursive(buf, 22); }


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

x86 assembly (clang, -O2):
<helper_double_22>:
mov    $0x16,%esi
jmp    1030 <helper_double_22_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_22(double* %0) {
%2 = tail call i32 @helper_double_22_recursive(double* %0, i32 22)
ret void
}
void X509_ATTRIBUTE_create(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ATTRIBUTE_create() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void innerfunc() { printf("inner\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"inner\00"
define void @innerfunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t _OneWireIntNumberGet(uint32_t ui32Base) {
  uint32_t ui32Int;
  ASSERT(ui32Base == 0x400B6000);
  ui32Int = 0;
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x000A0000))) {
    ui32Int = 121;
  }
  return (ui32Int);
}


x86 assembly (clang, -O0):
<_OneWireIntNumberGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400b6000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x100a0000,%eax
jne    1154 <_OneWireIntNumberGet+0x44>
movl   $0x79,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_OneWireIntNumberGet>:
push   %rax
xor    %eax,%eax
cmp    $0x400b6000,%edi
sete   %al
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
xor    %ecx,%ecx
cmp    $0x100a0000,%eax
mov    $0x79,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_OneWireIntNumberGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1074487296
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
store i32 0, i32* %3
%8 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%9 = and i32 %8, 1895759872
%10 = icmp eq i32 %9, 269090816
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 121, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @_OneWireIntNumberGet(i32 %0) {
%2 = icmp eq i32 %0, 1074487296
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%6 = and i32 %5, 1895759872
%7 = icmp eq i32 %6, 269090816
%8 = select i1 %7, i32 121, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usermode_crypto_help(int argc, char **argv) {
  printf("%s \n", "USERMOD CRYPTO HELP SECTION");
  exit(0);
}


x86 assembly (clang, -O0):
<usermode_crypto_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usermode_crypto_help>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [28 x i8] c"USERMOD CRYPTO HELP SECTION\00"
define void @usermode_crypto_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [28 x i8] c"USERMOD CRYPTO HELP SECTION\00"
define void @usermode_crypto_help(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stemmer {
  int dummy;
};

/* Variables and functions */
scalar_t__ m(struct stemmer *);
int /*<<< orphan*/ setto(struct stemmer *, char *);
void r(struct stemmer *z, char *s) {
  if (m(z) > 0)
    setto(z, s);
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <m@plt>
cmp    $0x0,%rax
jle    1150 <r+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <setto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <m@plt>
test   %rax,%rax
jle    1146 <r+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <setto@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = alloca %struct.stemmer*
%4 = alloca i8*
store %struct.stemmer* %0, %struct.stemmer** %3
store i8* %1, i8** %4
%5 = load %struct.stemmer*, %struct.stemmer** %3
%6 = call i64 @m(%struct.stemmer* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.stemmer*, %struct.stemmer** %3
%10 = load i8*, i8** %4
%11 = call i32 @setto(%struct.stemmer* %9, i8* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = tail call i64 @m(%struct.stemmer* %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @setto(%struct.stemmer* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_buffer(char buffer[], int length) {
  int i;
  for (i = 0; i < length; i++)
    putchar(buffer[i]);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <print_buffer+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_buffer+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <print_buffer+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_buffer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @print_buffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @putchar(i8 signext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_buffer(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
struct vectorClock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *return_vc_string(struct vectorClock *);
void print_vc(struct vectorClock *vc) {
  char *output = return_vc_string(vc);
  printf("%s\n", output);
  free(output);
}


x86 assembly (clang, -O0):
<print_vc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <return_vc_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vc>:
push   %rbx
call   1040 <return_vc_string@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.vectorClock = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @print_vc(%struct.vectorClock* %0) {
%2 = alloca %struct.vectorClock*
%3 = alloca i8*
store %struct.vectorClock* %0, %struct.vectorClock** %2
%4 = load %struct.vectorClock*, %struct.vectorClock** %2
%5 = call i8* @return_vc_string(%struct.vectorClock* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
%struct.vectorClock = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @print_vc(%struct.vectorClock* %0) {
%2 = tail call i8* @return_vc_string(%struct.vectorClock* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void abc(const char *str) {
  while (*str) {
    if (*str == ' ')
      printf("-");
    else
      printf("%c", *str);
    str++;
  }
}


x86 assembly (clang, -O0):
<abc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1172 <abc+0x62>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114c <abc+0x3c>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <abc+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <abc+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc>:
push   %rbx
mov    %rdi,%rbx
jmp    1129 <abc+0x19>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%rbx
movsbl (%rbx),%eax
mov    $0x2d,%edi
cmp    $0x20,%eax
je     1120 <abc+0x10>
test   %al,%al
je     113e <abc+0x2e>
mov    %eax,%edi
jmp    1120 <abc+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"%c\00"
define void @abc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %19, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
14: ; preds = %7
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %14, %12
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @abc(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %10, %7 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %11
i8 32, label %7
]
5: ; preds = %2
%6 = sext i8 %4 to i32
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 45, %2 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret void
}
int sdps_fill_read_reg(unsigned char *buf, unsigned addr, unsigned cnt) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sdps_fill_read_reg(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __kmap_hook(void *addr, unsigned int size, const char *file, int lineno) {
  do {
    fprintf(stderr, "FAIL: "
                    "Function instrumented in uninstrumented file.\n");
    exit(1);
  } while (1);
}


x86 assembly (clang, -O0):
<__kmap_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__kmap_hook>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"FAIL: Function instrumented in uninstrumented file.\0A\00"
define void @__kmap_hook(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; No predecessors!
br i1 true, label %9, label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"FAIL: Function instrumented in uninstrumented file.\0A\00"
define void @__kmap_hook(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}