xunge/DecIR huggingface dataset:
const char *read_while_reverse(const char *start, const char *end,
                               int(func)(int)) {
  end--;
  while (start <= end && func((unsigned char)*end))
    end--;
  end++;
  return end;
}


x86 assembly (clang, -O0):
<read_while_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
ja     1149 <read_while_reverse+0x49>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1159 <read_while_reverse+0x59>
jmp    116a <read_while_reverse+0x6a>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <read_while_reverse+0x20>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_while_reverse>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
add    $0xffffffffffffffff,%rsi
nop
mov    %rsi,%rbx
cmp    %r15,%rsi
jb     1126 <read_while_reverse+0x26>
movzbl (%rbx),%edi
call   *%r14
lea    -0x1(%rbx),%rsi
test   %eax,%eax
jne    1110 <read_while_reverse+0x10>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @read_while_reverse(i8* readnone %0, i8* %1, i32 (i32)* nocapture %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i8* [ %1, %3 ], [ %6, %8 ]
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = icmp ult i8* %6, %0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 %2(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %8
ret i8* %5
}
/* Type definitions */
struct termios {
  int c_lflag;
};

/* Variables and functions */
int ECHO;
int ECHOE;
int ICANON;
int ISIG;
void _noncanonical(struct termios *t) {
  t->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
}


x86 assembly (clang, -O0):
<_noncanonical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ed0(%rip),%rax
or     (%rax),%ecx
mov    0x2ebf(%rip),%rax
or     (%rax),%ecx
mov    0x2eae(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_noncanonical>:
mov    0x2ec1(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2ec7(%rip),%rax
or     (%rax),%ecx
mov    0x2eb6(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,(%rdi)
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@ICANON = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ISIG = global i32 0
define void @_noncanonical(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @ICANON
%4 = load i32, i32* @ECHO
%5 = or i32 %3, %4
%6 = load i32, i32* @ECHOE
%7 = or i32 %5, %6
%8 = load i32, i32* @ISIG
%9 = or i32 %7, %8
%10 = xor i32 %9, -1
%11 = load %struct.termios*, %struct.termios** %2
%12 = getelementptr inbounds %struct.termios, %struct.termios* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = and i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ICANON = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ISIG = global i32 0
define void @_noncanonical(%struct.termios* nocapture %0) {
%2 = load i32, i32* @ICANON
%3 = load i32, i32* @ECHO
%4 = or i32 %3, %2
%5 = load i32, i32* @ECHOE
%6 = or i32 %4, %5
%7 = load i32, i32* @ISIG
%8 = or i32 %6, %7
%9 = xor i32 %8, -1
%10 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%11 = load i32, i32* %10
%12 = and i32 %11, %9
store i32 %12, i32* %10
ret void
}
XUndefineCursor() {}


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

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

LLVM IR (-O0):
define i32 @XUndefineCursor() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XUndefineCursor() {
ret i32 undef
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (*s) {
    f(i, s);
    s++;
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <ft_striteri+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
tail call void %1(i32 %6, i8* %7)
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add i32 %6, 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int mmemcmp(void *const source, void *const end, int elem_size) { return 1; }


x86 assembly (clang, -O0):
<mmemcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mmemcmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
unsigned int sha1_circular_shift(unsigned int bits, unsigned int word) {
  return (((word) << (bits)) | ((word) >> (32 - (bits))));
}


x86 assembly (clang, -O0):
<sha1_circular_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_circular_shift>:
mov    %esi,%eax
mov    %edi,%ecx
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @sha1_circular_shift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @sha1_circular_shift(i32 %0, i32 %1) {
%3 = shl i32 %1, %0
%4 = sub i32 32, %0
%5 = lshr i32 %1, %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_muxer();
int /*<<< orphan*/ test_ring_buffer();
int /*<<< orphan*/ test_status_writer();
int main(int argc, char **argv) {
  test_ring_buffer();
  test_muxer();
  test_status_writer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test_ring_buffer@plt>
mov    $0x0,%al
call   1030 <test_muxer@plt>
mov    $0x0,%al
call   1040 <test_status_writer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_ring_buffer()
%7 = call i32 (...) @test_muxer()
%8 = call i32 (...) @test_status_writer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_ring_buffer()
%4 = tail call i32 (...) @test_muxer()
%5 = tail call i32 (...) @test_status_writer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void MSG_Error_ServerConfigError(void) { exit(1); }


x86 assembly (clang, -O0):
<MSG_Error_ServerConfigError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<MSG_Error_ServerConfigError>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @MSG_Error_ServerConfigError() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @MSG_Error_ServerConfigError() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ksft_exit_xpass(void) { exit(3); }


x86 assembly (clang, -O0):
<ksft_exit_xpass>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ksft_exit_xpass>:
push   %rax
mov    $0x3,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @ksft_exit_xpass() {
%1 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_xpass() {
%1 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *private_strerror(int);
int /*<<< orphan*/ stderr;
void print_errno_message(int errnum) {
  char const *s;
  s = private_strerror(errnum);
  if (!s)
    s = "Unknown system error";
  fprintf(stderr, ": %s", s);
}


x86 assembly (clang, -O0):
<print_errno_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <private_strerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <print_errno_message+0x2d>
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errno_message>:
push   %rax
call   1030 <private_strerror@plt>
test   %rax,%rax
lea    0xed0(%rip),%rdx
cmovne %rax,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unknown system error\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c": %s\00"
define void @print_errno_message(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @private_strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unknown system error\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c": %s\00"
define void @print_errno_message(i32 %0) {
%2 = tail call i8* @private_strerror(i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
char *TAG(char *, int, int /*<<< orphan*/, int /*<<< orphan*/, int, char *,
          char *, char *, char *);
char *CSS(char *str, int ilev) {
  return TAG("link", 2, 0, 0, ilev, "rel", "stylesheet", "href", str);
}


x86 assembly (clang, -O0):
<CSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%rax
lea    0xed2(%rip),%rdi
mov    $0x2,%esi
xor    %ecx,%ecx
lea    0xec9(%rip),%r9
lea    0xec6(%rip),%r11
lea    0xeca(%rip),%r10
mov    %ecx,%edx
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <TAG@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSS>:
push   %rax
mov    %esi,%r8d
mov    %rdi,%rax
sub    $0x8,%rsp
lea    0xef2(%rip),%r10
lea    0xee0(%rip),%r11
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%r9
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
push   %rax
push   %r10
push   %r11
call   1030 <TAG@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"link\00"
@.str.1 = [4 x i8] c"rel\00"
@.str.2 = [11 x i8] c"stylesheet\00"
@.str.3 = [5 x i8] c"href\00"
define i8* @CSS(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @TAG(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 0, i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"link\00"
@.str.1 = [4 x i8] c"rel\00"
@.str.2 = [11 x i8] c"stylesheet\00"
@.str.3 = [5 x i8] c"href\00"
define i8* @CSS(i8* %0, i32 %1) {
%3 = tail call i8* @TAG(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 0, i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int rat_mod_generic_set_val_zero32(const char *argv, uint8_t *data,
                                   uint16_t len) {
  do {
  } while (0);
  if (!argv || !data || len < sizeof(uint32_t))
    return -1;
  *((uint32_t *)data) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<rat_mod_generic_set_val_zero32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
jmp    1114 <rat_mod_generic_set_val_zero32+0x14>
cmpq   $0x0,-0x10(%rbp)
je     1138 <rat_mod_generic_set_val_zero32+0x38>
cmpq   $0x0,-0x18(%rbp)
je     1138 <rat_mod_generic_set_val_zero32+0x38>
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    1144 <rat_mod_generic_set_val_zero32+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <rat_mod_generic_set_val_zero32+0x56>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_generic_set_val_zero32>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111d <rat_mod_generic_set_val_zero32+0x1d>
test   %rsi,%rsi
je     111d <rat_mod_generic_set_val_zero32+0x1d>
cmp    $0x8,%edx
jb     111d <rat_mod_generic_set_val_zero32+0x1d>
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rat_mod_generic_set_val_zero32(i8* readnone %0, i32* writeonly %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i32* %1, null
%6 = or i1 %4, %5
%7 = icmp ult i32 %2, 8
%8 = or i1 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = bitcast i32* %1 to i64*
store i64 0, i64* %10
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ 0, %9 ], [ -1, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int e, a;
  scanf("%i", &e);
  f(&a, e);
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1030 <f@plt>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @f(i32* %2, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f17();
__attribute__((returns_twice)) void f18(void) { f17(); }


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

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

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

LLVM IR (-O2):
define void @f18() {
%1 = tail call i32 (...) @f17()
ret void
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_MTU_DISCOVER;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int get_df(int fd) {
  int optval = 0;
  socklen_t optlen = sizeof(optval);
  int r = getsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &optval, &optlen);
  if (r == -1)
    return -1;
  return optval;
}


x86 assembly (clang, -O0):
<get_df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1164 <get_df+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <get_df+0x5a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_df>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
je     1147 <get_df+0x37>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_MTU_DISCOVER = global i32 0
define i32 @get_df(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* @IPPROTO_IP
%9 = load i32, i32* @IP_MTU_DISCOVER
%10 = call i32 @getsockopt(i32 %7, i32 %8, i32 %9, i32* %4, i32* %5)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_MTU_DISCOVER = global i32 0
define i32 @get_df(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @IPPROTO_IP
%7 = load i32, i32* @IP_MTU_DISCOVER
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp eq i32 %8, -1
%10 = load i32, i32* %2
%11 = select i1 %9, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_hello() {
  printf("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *dlopen(char const *const, int const);
void *dylib_open(const char *const filename, const int flags) {
  return dlopen(filename, flags);
}


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

x86 assembly (clang, -O2):
<dylib_open>:
jmp    1030 <dlopen@plt>

LLVM IR (-O0):
define i8* @dylib_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @dlopen(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @dylib_open(i8* %0, i32 %1) {
%3 = tail call i8* @dlopen(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __nesc_enable_interrupt();
void __nesc_atomic_sleep() {
  __nesc_enable_interrupt();
  return;
}


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

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

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

LLVM IR (-O2):
define void @__nesc_atomic_sleep() {
%1 = tail call i32 (...) @__nesc_enable_interrupt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  printf("Entre com 2 números: ");
  scanf("%i %i", &x, &y);
  int z = x + y;
  printf("\n%i", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Entre com 2 n\C3\BAmeros: \00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [4 x i8] c"\0A%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Entre com 2 n\C3\BAmeros: \00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [4 x i8] c"\0A%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
void *malloca_set_mark__(void *ptr, int mark) {
  if (ptr != NULL) {
    int *x = (int *)ptr;
    *x = mark;
    ptr = (void *)((char *)ptr + sizeof(void *));
  }
  return ptr;
}


x86 assembly (clang, -O0):
<malloca_set_mark__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <malloca_set_mark__+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloca_set_mark__>:
test   %rdi,%rdi
je     110f <malloca_set_mark__+0xf>
mov    %rdi,%rax
mov    %esi,(%rdi)
add    $0x8,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @malloca_set_mark__(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %5
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 8
store i8* %14, i8** %3
br label %15
15: ; preds = %8, %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @malloca_set_mark__(i8* writeonly %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
store i32 %1, i32* %5
%6 = getelementptr inbounds i8, i8* %0, i64 8
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %8
}
void _raise_exception() {
  char *p;
  p = (char *)01;
  *p = 99;
}


x86 assembly (clang, -O0):
<_raise_exception>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x63,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_raise_exception>:
movb   $0x63,0x1
63
ret

LLVM IR (-O0):
define void @_raise_exception() {
%1 = alloca i8*
store i8* inttoptr (i64 1 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 99, i8* %2
ret void
}

LLVM IR (-O2):
define void @_raise_exception() {
store i8 99, i8* inttoptr (i64 1 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace_printk(char *, unsigned int, unsigned int);
void ms_mci(unsigned long long timestamp, unsigned char cnt,
            unsigned int *value) {
  switch (cnt) {
  case 2:
    trace_printk("%x,%x\n", value[0], value[1]);
    break;
  }
}


x86 assembly (clang, -O0):
<ms_mci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x9(%rbp),%al
sub    $0x2,%al
jne    114f <ms_mci+0x3f>
jmp    1136 <ms_mci+0x26>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xeb6(%rip),%rdi
call   1030 <trace_printk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_mci>:
cmp    $0x2,%sil
jne    1127 <ms_mci+0x17>
mov    (%rdx),%esi
mov    0x4(%rdx),%edx
lea    0xede(%rip),%rdi
jmp    1030 <trace_printk@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%x,%x\0A\00"
define void @ms_mci(i64 %0, i8 zeroext %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i32*
store i64 %0, i64* %4
store i8 %1, i8* %5
store i32* %2, i32** %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
switch i32 %8, label %17 [
i32 2, label %9
]
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = call i32 @trace_printk(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15)
br label %17
17: ; preds = %3, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%x,%x\0A\00"
define void @ms_mci(i64 %0, i8 zeroext %1, i32* nocapture %2) {
%4 = icmp eq i8 %1, 2
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @trace_printk(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
br label %10
10: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void gpioWrite(int gpio, char *value) {
  char buf[255];
  int fd;
  sprintf(buf, "/sys/class/gpio/gpio%d/value", gpio);
  fd = open(buf, O_WRONLY);
  write(fd, value, 1);
  close(fd);
}


x86 assembly (clang, -O0):
<gpioWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x114(%rbp),%edi
call   1040 <close@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioWrite>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%r14
mov    %edi,%edx
lea    0xeaa(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
add    $0x108,%rsp
pop    %rbx
pop    %r14
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"/sys/class/gpio/gpio%d/value\00"
@O_WRONLY = global i32 0
define void @gpioWrite(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [255 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @O_WRONLY
%12 = call i32 @open(i8* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i8*, i8** %4
%15 = call i32 @write(i32 %13, i8* %14, i32 1)
%16 = load i32, i32* %6
%17 = call i32 @close(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"/sys/class/gpio/gpio%d/value\00"
@O_WRONLY = global i32 0
define void @gpioWrite(i32 %0, i8* nocapture %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = load i32, i32* @O_WRONLY
%7 = call i32 @open(i8* %4, i32 %6)
%8 = tail call i32 @write(i32 %7, i8* %1, i32 1)
%9 = tail call i32 @close(i32 %7)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *ALdistortionState_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALdistortionState_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ALdistortionState_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void authexit(int rc) { exit(rc); }


x86 assembly (clang, -O0):
<authexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<authexit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @authexit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char const *, char *, size_t);
char *malloc(size_t);
size_t strlen(char const *);
char *strdup(const char *str) {
  size_t len = strlen(str);
  char *out = malloc((len + 1) * sizeof(char));
  bcopy((str), (out), ((len + 1)));
  ;
  return out;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1050 <bcopy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 %8, 1
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = call i32 @bcopy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %3, i1 false)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void normalSum(int number) {
  int sum = 0, i;
  for (i = number; i > 0; i--) {
    sum += number;
    number--;
  }
  printf("A soma (normal) foi: %d\n", sum);
}


x86 assembly (clang, -O0):
<normalSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1152 <normalSum+0x42>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <normalSum+0x18>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalSum>:
test   %edi,%edi
jle    1136 <normalSum+0x26>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
mov    %eax,%esi
imul   %eax,%esi
shr    %rcx
add    %edi,%esi
sub    %ecx,%esi
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>
xor    %esi,%esi
lea    0xec1(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"A soma (normal) foi: %d\0A\00"
define void @normalSum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
%16 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}
int Num_Pos(int i, int j, int k, int J, int K) {
  static int result;
  result = k + j * (K + 1) + i * (K + 1) * (J + 1);
  return result;
}


x86 assembly (clang, -O0):
<Num_Pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,0x2ee2(%rip)
mov    0x2edc(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Num_Pos>:
add    $0x1,%r8d
lea    0x1(%rcx),%eax
imul   %edi,%eax
add    %esi,%eax
imul   %r8d,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
@Num_Pos.result = internal global i32 0
define i32 @Num_Pos(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = load i32, i32* %7
%13 = load i32, i32* %10
%14 = add nsw i32 %13, 1
%15 = mul nsw i32 %12, %14
%16 = add nsw i32 %11, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %10
%19 = add nsw i32 %18, 1
%20 = mul nsw i32 %17, %19
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
%23 = mul nsw i32 %20, %22
%24 = add nsw i32 %16, %23
store i32 %24, i32* @Num_Pos.result
%25 = load i32, i32* @Num_Pos.result
ret i32 %25
}

LLVM IR (-O2):
define i32 @Num_Pos(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %4, 1
%7 = add nsw i32 %3, 1
%8 = mul i32 %7, %0
%9 = add i32 %8, %1
%10 = mul i32 %9, %6
%11 = add i32 %10, %2
ret i32 %11
}
int equal_int(void *a, void *b) {
  int *aa, *bb;
  aa = (int *)a;
  bb = (int *)b;
  return *aa == *bb;
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Fatal_OutOfMemory(void) {
  fprintf(stderr, "*** OUT OF MEMORY ***\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Fatal_OutOfMemory>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Fatal_OutOfMemory>:
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 = [23 x i8] c"*** OUT OF MEMORY ***\0A\00"
define void @Fatal_OutOfMemory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"*** OUT OF MEMORY ***\0A\00"
define void @Fatal_OutOfMemory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeDHBuf(void *buf) { free(buf); }


x86 assembly (clang, -O0):
<freeDHBuf>:
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):
<freeDHBuf>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeDHBuf(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int BTSHASP_OpChar(int ch) {
  if (ch <= ' ')
    return (0);
  if ((ch >= '0') && (ch <= '9'))
    return (0);
  if ((ch >= 'A') && (ch <= 'Z'))
    return (0);
  if ((ch >= 'a') && (ch <= 'z'))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<BTSHASP_OpChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jg     111d <BTSHASP_OpChar+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <BTSHASP_OpChar+0x84>
cmpl   $0x30,-0x8(%rbp)
jl     113d <BTSHASP_OpChar+0x3d>
cmpl   $0x39,-0x8(%rbp)
jg     113d <BTSHASP_OpChar+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <BTSHASP_OpChar+0x84>
cmpl   $0x41,-0x8(%rbp)
jl     115d <BTSHASP_OpChar+0x5d>
cmpl   $0x5a,-0x8(%rbp)
jg     115d <BTSHASP_OpChar+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <BTSHASP_OpChar+0x84>
cmpl   $0x61,-0x8(%rbp)
jl     117d <BTSHASP_OpChar+0x7d>
cmpl   $0x7a,-0x8(%rbp)
jg     117d <BTSHASP_OpChar+0x7d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <BTSHASP_OpChar+0x84>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTSHASP_OpChar>:
cmp    $0x21,%edi
setge  %al
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
setae  %cl
and    %al,%cl
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
setae  %al
add    $0xffffff85,%edi
cmp    $0xffffffe6,%edi
setb   %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @BTSHASP_OpChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %29
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 57
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %2
br label %29
14: ; preds = %10, %7
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 0, i32* %2
br label %29
21: ; preds = %17, %14
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 97
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 0, i32* %2
br label %29
28: ; preds = %24, %21
store i32 1, i32* %2
br label %29
29: ; preds = %28, %27, %20, %13, %6
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @BTSHASP_OpChar(i32 %0) {
%2 = icmp slt i32 %0, 33
%3 = add i32 %0, -48
%4 = icmp ult i32 %3, 10
%5 = or i1 %2, %4
%6 = add i32 %0, -65
%7 = icmp ult i32 %6, 26
%8 = or i1 %7, %5
%9 = add i32 %0, -123
%10 = icmp ult i32 %9, -26
%11 = xor i1 %8, true
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}