xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello loopgrind\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hello loopgrind\0A\00"
define i32 @main(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 ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello loopgrind\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ system(char *);
int idevicename() {
  system("clear; idevicename");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"clear; idevicename\00"
@EXIT_SUCCESS = global i32 0
define i32 @idevicename() {
%1 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@.str = [19 x i8] c"clear; idevicename\00"
@EXIT_SUCCESS = global i32 0
define i32 @idevicename() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int main() {
  volatile int foo[10];
  foo[10] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 10
store volatile i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Expander_Write_Byte(char, int, int);
void Expander_Init(char ModuleAddress) {
  Expander_Write_Byte(ModuleAddress, 0x02, 0x00);
}


x86 assembly (clang, -O0):
<Expander_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%esi
xor    %edx,%edx
movsbl -0x1(%rbp),%edi
call   1030 <Expander_Write_Byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Expander_Init>:
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <Expander_Write_Byte@plt>

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

LLVM IR (-O2):
define void @Expander_Init(i8 signext %0) {
%2 = tail call i32 @Expander_Write_Byte(i8 signext %0, i32 2, i32 0)
ret void
}
__typeof__(toupper(1)) test_toupper_79(void) { return toupper(1); }


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

x86 assembly (clang, -O2):
<test_toupper_79>:
mov    $0x1,%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @test_toupper_79() {
%1 = call i32 @toupper(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_toupper_79() {
%1 = tail call i32 @toupper(i32 1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int, char *, int);
int strlen(char *);
char *create_hn(char *s, int level) {
  char *_str, *format = "<h%d>%s</h%d>\n";
  _str = (char *)malloc(strlen(s) + strlen(format) - 2 + 1);
  sprintf(_str, format, level, s, level);
  return _str;
}


x86 assembly (clang, -O0):
<create_hn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
add    %eax,%edi
sub    $0x2,%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_hn>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r14d
lea    0xeb3(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%edi
add    $0xffffffff,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
mov    %rbx,%rcx
mov    %r12d,%r8d
call   1050 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"<h%d>%s</h%d>\0A\00"
define i8* @create_hn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = sub nsw i32 %11, 2
%13 = add nsw i32 %12, 1
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = load i32, i32* %4
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = call i32 @sprintf(i8* %16, i8* %17, i32 %18, i8* %19, i32 %20)
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@.str = [15 x i8] c"<h%d>%s</h%d>\0A\00"
define i8* @create_hn(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = add i32 %3, -1
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i32 %1)
ret i8* %8
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetRedVideoBlackLevel(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "RenderingControl/SetRedVideoBlackLevel[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetRedVideoBlackLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/SetRedVideoBlackLevel[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetRedVideoBlackLevel(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/SetRedVideoBlackLevel[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetRedVideoBlackLevel(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int _socket_close(int sock) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_socket_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void sendMessage(int sock_fd, char *buf, int count) {
  write(sock_fd, buf, count);
}


x86 assembly (clang, -O0):
<sendMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMessage>:
jmp    1030 <write@plt>

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

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

/* Variables and functions */
int bnrand(int, int /*<<< orphan*/ *, int, int, int);
int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) {
  return bnrand(2, rnd, bits, top, bottom);
}


x86 assembly (clang, -O0):
<BN_bntest_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x2,%edi
call   1030 <bnrand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_bntest_rand>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <bnrand@plt>

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

LLVM IR (-O2):
define i32 @BN_bntest_rand(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @bnrand(i32 2, i32* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
strip_blank(char *buffer, unsigned char len) {
  unsigned char i;
  for (i = len; i > 0; i--) {
    if (buffer[i] != ' ') {
      break;
    } else {
      buffer[i] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<strip_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jle    1159 <strip_blank+0x59>
mov    -0x10(%rbp),%rax
movzbl -0x12(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     113b <strip_blank+0x3b>
jmp    1159 <strip_blank+0x59>
mov    -0x10(%rbp),%rax
movzbl -0x12(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
jmp    114c <strip_blank+0x4c>
mov    -0x12(%rbp),%al
add    $0xff,%al
mov    %al,-0x12(%rbp)
jmp    1114 <strip_blank+0x14>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_blank>:
test   %esi,%esi
je     1122 <strip_blank+0x22>
movzbl %sil,%eax
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,(%rdi,%rax,1)
jne    1122 <strip_blank+0x22>
movb   $0x0,(%rdi,%rax,1)
add    $0xffffffffffffffff,%rax
test   %al,%al
jne    1110 <strip_blank+0x10>
ret

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

LLVM IR (-O2):
define i32 @strip_blank(i8* nocapture %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i8 [ %11, %10 ], [ %1, %2 ]
%6 = zext i8 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %4
store i8 0, i8* %7
%11 = add i8 %5, -1
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %10, %4, %2
ret i32 undef
}
void RTStrToUInt8(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUInt8() {
ret void
}
void delete_old_entries(int interval) {}


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

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

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

LLVM IR (-O2):
define void @delete_old_entries(i32 %0) {
ret void
}
int go(int a) { return (a + 1); }


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

x86 assembly (clang, -O2):
<go>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @go(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @go(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int f0(int x) {
  int vla[x];
  return vla[x - 1];
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f0(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = load i8*, i8** %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @f0(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ thread_listen_node();
int main() { thread_listen_node(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @thread_listen_node()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int system(char *);
int if_down(char *name) {
  char buf[128];
  snprintf(buf, sizeof(buf), "ifconfig %s down", name);
  int ret = system(buf);
  if (ret != 0) {
    printf("Could not bring down interface %s\n", name);
  }
  return ret;
}


x86 assembly (clang, -O0):
<if_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xeaa(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     118a <if_down+0x5a>
mov    -0x8(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_down>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
lea    0xebd(%rip),%rdx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <system@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1173 <if_down+0x43>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ifconfig %s down\00"
@.str.1 = [35 x i8] c"Could not bring down interface %s\0A\00"
define i32 @if_down(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @snprintf(i8* %5, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"ifconfig %s down\00"
@.str.1 = [35 x i8] c"Could not bring down interface %s\0A\00"
define i32 @if_down(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
ret i32 %5
}
unsigned short FastUIntUShortDiv(unsigned int x, unsigned short y) {
  return x / y;
}


x86 assembly (clang, -O0):
<FastUIntUShortDiv>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
xor    %edx,%edx
div    %ecx
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastUIntUShortDiv>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define zeroext i16 @FastUIntUShortDiv(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = udiv i32 %5, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @FastUIntUShortDiv(i32 %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = udiv i32 %0, %3
%5 = trunc i32 %4 to i16
ret i16 %5
}
unsigned short sdmmc_read16(unsigned short reg) {
  return *(volatile unsigned short *)(0x10006000u + reg);
}


x86 assembly (clang, -O0):
<sdmmc_read16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10006000,%eax
mov    %eax,%eax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_read16>:
mov    %edi,%eax
movzwl 0x10006000(%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @sdmmc_read16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add i32 268460032, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i16*
%8 = load volatile i16, i16* %7
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @sdmmc_read16(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = add nuw nsw i64 %2, 268460032
%4 = inttoptr i64 %3 to i16*
%5 = load volatile i16, i16* %4
ret i16 %5
}
/* Variables and functions */
double ln(scalar_t__);
scalar_t__ sqrt(int);
double arcsinh(double n) { return ln(n + sqrt(1 + n * n)); }


x86 assembly (clang, -O0):
<arcsinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <ln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arcsinh>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeca(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1040 <ln@plt>

LLVM IR (-O0):
define double @arcsinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call i64 @sqrt(i32 %7)
%9 = sitofp i64 %8 to double
%10 = fadd double %3, %9
%11 = fptosi double %10 to i64
%12 = call double @ln(i64 %11)
ret double %12
}

LLVM IR (-O2):
define double @arcsinh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call i64 @sqrt(i32 %3)
%5 = sitofp i64 %4 to double
%6 = fadd double %5, %0
%7 = fptosi double %6 to i64
%8 = tail call double @ln(i64 %7)
ret double %8
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hashtable *);
int /*<<< orphan*/ hashtable_destroy(struct hashtable *);
void hashtable_free(struct hashtable *ht) {
  ;
  hashtable_destroy(ht);
  ;
  free(ht);
}


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

x86 assembly (clang, -O2):
<hashtable_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hashtable_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

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

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define void @hashtable_free(%struct.hashtable* %0) {
%2 = tail call i32 @hashtable_destroy(%struct.hashtable* %0)
%3 = tail call i32 @free(%struct.hashtable* %0)
ret void
}
int square_digits(int n) {
  const int pow2[] = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100};
  int sum = 0;
  while (n) {
    sum += pow2[n % 10];
    n /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<square_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <square_digits+0x5c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1137 <square_digits+0x27>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1140 <square_digits+0x40>
lea    0xef3(%rip),%r8
nopl   (%rax)
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdi
add    %esi,%edi
lea    (%rdi,%rdi,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%ecx
sub    %esi,%ecx
movslq %ecx,%rcx
add    (%r8,%rcx,4),%eax
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <square_digits+0x10>
ret

LLVM IR (-O0):
@__const.square_digits.pow2 = [11 x i32] [i32 0, i32 1, i32 4, i32 9, i32 16, i32 25, i32 36, i32 49, i32 64, i32 81, i32 100]
define i32 @square_digits(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [11 x i32]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 10
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@__const.square_digits.pow2 = [11 x i32] [i32 0, i32 1, i32 4, i32 9, i32 16, i32 25, i32 36, i32 49, i32 64, i32 81, i32 100]
define i32 @square_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [11 x i32], [11 x i32]* @__const.square_digits.pow2, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %4
%11 = sdiv i32 %5, 10
%12 = add i32 %5, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %15
}
/* Variables and functions */
int powf(float, double);
float depth_sensor_v2cm(int sensor_value) {
  float volts = sensor_value * 0.00322265625;
  float distance = 65 * powf(volts, -1.10);
  return distance;
}


x86 assembly (clang, -O0):
<depth_sensor_v2cm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
call   1030 <powf@plt>
imul   $0x41,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth_sensor_v2cm>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xedf(%rip),%xmm1
call   1030 <powf@plt>
mov    %eax,%ecx
shl    $0x6,%ecx
add    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @depth_sensor_v2cm(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3F6A666666666666
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @powf(float %9, double -1.100000e+00)
%11 = mul nsw i32 65, %10
%12 = sitofp i32 %11 to float
store float %12, float* %4
%13 = load float, float* %4
ret float %13
}

LLVM IR (-O2):
define float @depth_sensor_v2cm(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F6A666666666666
%4 = fptrunc double %3 to float
%5 = tail call i32 @powf(float %4, double -1.100000e+00)
%6 = mul nsw i32 %5, 65
%7 = sitofp i32 %6 to float
ret float %7
}
void ceph_fscache_unregister(void) {}


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

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

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

LLVM IR (-O2):
define void @ceph_fscache_unregister() {
ret void
}
int scmp(char *str1, char *str2) {
  while (*str1 == *str2) {
    if (*str1 == '\0') {
      return 0;
    }
    str1++, str2++;
  }
  return *str1 - *str2;
}


x86 assembly (clang, -O0):
<scmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <scmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <scmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <scmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <scmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <scmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <scmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <scmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %25
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %33
20: ; preds = %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
br label %6
25: ; preds = %6
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %5
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
store i32 %32, i32* %3
br label %33
33: ; preds = %25, %19
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
int test_ptr(int *no1, int *no2) { return (*no1 + *no2); }


x86 assembly (clang, -O0):
<test_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_ptr(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_ptr(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
long simple_strtoull(char const *, char **, unsigned int);
long simple_strtol(const char *cp, char **endp, unsigned int base) {
  if (*cp == '-')
    return -simple_strtoull(cp + 1, endp, base);
  return simple_strtoull(cp, endp, base);
}


x86 assembly (clang, -O0):
<simple_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1158 <simple_strtol+0x48>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoull@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <simple_strtol+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoull@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtol>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <simple_strtol+0x14>
add    $0x1,%rdi
call   1030 <simple_strtoull@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <simple_strtoull@plt>

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

LLVM IR (-O2):
define i64 @simple_strtol(i8* %0, i8** %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @simple_strtoull(i8* %7, i8** %1, i32 %2)
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %3
%11 = tail call i64 @simple_strtoull(i8* %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("2D IFS 1.0, Adrian Smith, 1997\n"
         "Parameters:\n"
         "  Size of image          -size    100x100\n"
         "  Filename to write to   -output  output.bmp\n"
         "  File containing defs   -defs    fractint.ifs\n"
         "  Name of IFS            -ifs     fern\n"
         "  No. of points to skip  -skip    10\n"
         "  No. of points to calc  -points  1000\n"
         "Note: Image is cropped\n");
}


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

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

LLVM IR (-O0):
@.str = [316 x i8] c"2D IFS 1.0, Adrian Smith, 1997\0AParameters:\0A Size of image -size 100x100\0A Filename to write to -output output.bmp\0A File containing defs -defs fractint.ifs\0A Name of IFS -ifs fern\0A No. of points to skip -skip 10\0A No. of points to calc -points 1000\0ANote: Image is cropped\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [315 x i8] c"2D IFS 1.0, Adrian Smith, 1997\0AParameters:\0A Size of image -size 100x100\0A Filename to write to -output output.bmp\0A File containing defs -defs fractint.ifs\0A Name of IFS -ifs fern\0A No. of points to skip -skip 10\0A No. of points to calc -points 1000\0ANote: Image is cropped\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([315 x i8], [315 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int p(int semidgroup, int donut_type) {
  struct sembuf semopbuf;
  semopbuf.sem_num = donut_type;
  semopbuf.sem_op = (-1);
  semopbuf.sem_flg = 0;
  if (semop(semidgroup, &semopbuf, 1) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1159 <p+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <p+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @p(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 -1, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = call i32 @semop(i32 %11, %struct.sembuf* %6, i32 1)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @p(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ LPUART7_DriverIRQHandler();
__attribute__((weak)) void LPUART7_IRQHandler(void) {
  LPUART7_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPUART7_IRQHandler() {
%1 = call i32 (...) @LPUART7_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPUART7_IRQHandler() {
%1 = tail call i32 (...) @LPUART7_DriverIRQHandler()
ret void
}
/* Variables and functions */
int isxdigit(unsigned char);
int isHexDigit(const char *ptr) { return isxdigit(*(unsigned char *)ptr); }


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

x86 assembly (clang, -O2):
<isHexDigit>:
movzbl (%rdi),%edi
jmp    1030 <isxdigit@plt>

LLVM IR (-O0):
define i32 @isHexDigit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @isxdigit(i8 zeroext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @isHexDigit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isxdigit(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
int check_enable(const char *password) {
  return !strcasecmp(password, "topsecret");
}


x86 assembly (clang, -O0):
<check_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_enable>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"topsecret\00"
define i32 @check_enable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"topsecret\00"
define i32 @check_enable(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
__attribute__((weak)) void rgblight_increase_speed(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_increase_speed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xb0() {
  Assert_real((isspace(176) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              885, ("isspace should be 0 for 0xb0"));
}


x86 assembly (clang, -O0):
<t_isspace_0xb0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x375,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xb0>:
push   %rax
mov    $0xb0,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x375,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xb0\00"
define void @t_isspace_0xb0() {
%1 = call i64 @isspace(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xb0\00"
define void @t_isspace_0xb0() {
%1 = tail call i64 @isspace(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ENODEV;
int sysfs_set_sched(const char *smt_mc, int val) { return -ENODEV; }


x86 assembly (clang, -O0):
<sysfs_set_sched>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sysfs_set_sched(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int putchar(char const);
void ft_printf_string(const char *string) {
  int i;
  int result;
  i = 0;
  while (string[i] != '\0') {
    result = putchar(string[i]);
    i++;
  }
  (void)result;
}


x86 assembly (clang, -O0):
<ft_printf_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115a <ft_printf_string+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_printf_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_printf_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_printf_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_printf_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_printf_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t __attribute__((section(".iram1"))) DPORT_READ_PERI_REG(uint32_t reg) {
  return (*(volatile uint32_t *)(reg));
}


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

x86 assembly (clang, -O2):
<DPORT_READ_PERI_REG>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @DPORT_READ_PERI_REG(i64 %0) section ".iram1" {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @DPORT_READ_PERI_REG(i64 %0) section ".iram1" {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}