xunge/DecIR huggingface dataset:
int ft_strlen(const char *const str) {
  int len;
  len = 0;
  while (str[len] != '\0')
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
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     1132 <ft_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int host_request_exec_args_linux(char *buffer, int max_buffer_size) {
  int ret;
  memset(buffer, 0, max_buffer_size);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, "
                       "0x20"
                       "\n"
                       ".byte "
                       "0x03"
                       ", 0x00\n"
                       ".byte 0x00, 0x00, 0x00\n"
                       ".byte 0x00\n"
                       : "=a"(ret)
                       : "a"(buffer), "b"(max_buffer_size));
  return ret;
}


x86 assembly (clang, -O0):
<host_request_exec_args_linux>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ebx
(bad)
add    %ah,(%rax)
add    (%rax),%eax
add    %al,(%rax)
add    %al,(%rax)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_request_exec_args_linux>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
(bad)
add    %ah,(%rax)
add    (%rax),%eax
add    %al,(%rax)
add    %al,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @host_request_exec_args_linux(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 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x20\0A.byte 0x03, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @host_request_exec_args_linux(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %3, i1 false)
%4 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x20\0A.byte 0x03, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ pthread_self();
void *foo_fn(void *ptr) {
  char *msg;
  msg = (char *)ptr;
  printf("[%05d] %s\n", getpid(), msg);
  printf("[%05d] mytid is %lu\n", getpid(), (unsigned long)pthread_self());
  return 0;
}


x86 assembly (clang, -O0):
<foo_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x14(%rbp),%esi
mov    %rax,%rdx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_fn>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"[%05d] %s\0A\00"
@.str.1 = [21 x i8] c"[%05d] mytid is %lu\0A\00"
define i8* @foo_fn(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = call i32 (...) @getpid()
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = call i32 (...) @getpid()
%9 = call i64 (...) @pthread_self()
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %8, i64 %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [11 x i8] c"[%05d] %s\0A\00"
@.str.1 = [21 x i8] c"[%05d] mytid is %lu\0A\00"
define noalias i8* @foo_fn(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
%4 = tail call i32 (...) @getpid()
%5 = tail call i64 (...) @pthread_self()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %4, i64 %5)
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiringPiSPIDataRW(int, int *, int);
void writeByte(uint8_t spiPort, uint8_t devId, uint8_t reg, uint8_t data) {
  uint8_t spiData[4];
  spiData[0] = 0x40 | ((devId & 7) << 1);
  spiData[1] = reg;
  spiData[2] = data;
  wiringPiSPIDataRW(spiPort, spiData, 3);
}


x86 assembly (clang, -O0):
<writeByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7,%eax
shl    $0x1,%eax
or     $0x40,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x3,%edx
call   1030 <wiringPiSPIDataRW@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeByte>:
sub    $0x18,%rsp
and    $0x7,%esi
lea    (%rsi,%rsi,1),%eax
add    $0x40,%eax
mov    %eax,(%rsp)
mov    %edx,0x4(%rsp)
mov    %ecx,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edx
call   1030 <wiringPiSPIDataRW@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @writeByte(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = and i32 %10, 7
%12 = shl i32 %11, 1
%13 = or i32 64, %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %7
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %17, i32* %18
%19 = load i32, i32* %5
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%21 = call i32 @wiringPiSPIDataRW(i32 %19, i32* %20, i32 3)
ret void
}

LLVM IR (-O2):
define void @writeByte(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = shl i32 %1, 1
%8 = and i32 %7, 14
%9 = or i32 %8, 64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %9, i32* %10
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %2, i32* %11
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %3, i32* %12
%13 = call i32 @wiringPiSPIDataRW(i32 %0, i32* %10, i32 3)
ret void
}
void test() { auto int b = 0; }


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int KEY_RESERVED;
int device_toggle_display(volatile char *key_pressed, int key_code) {
  return key_code == KEY_RESERVED;
}


x86 assembly (clang, -O0):
<device_toggle_display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ecb(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_toggle_display>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %esi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@KEY_RESERVED = global i32 0
define i32 @device_toggle_display(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 i32, i32* @KEY_RESERVED
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@KEY_RESERVED = global i32 0
define i32 @device_toggle_display(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @KEY_RESERVED
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ INT16_MAX;
scalar_t__ INT16_MIN;
scalar_t__ __stdfix_sat_hk(scalar_t__);
int32_t __stdfix_smul_hk(int32_t x, int32_t y) {
  if (x == INT16_MIN && y == INT16_MIN)
    return (INT16_MAX);
  return (__stdfix_sat_hk(((int32_t)x * (int32_t)y) >> 7));
}


x86 assembly (clang, -O0):
<__stdfix_smul_hk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_hk+0x4b>
mov    -0x18(%rbp),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_hk+0x4b>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <__stdfix_smul_hk+0x61>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
sar    $0x7,%rdi
call   1030 <__stdfix_sat_hk@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_hk>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
jne    112f <__stdfix_smul_hk+0x1f>
cmp    %rsi,%rax
jne    112f <__stdfix_smul_hk+0x1f>
mov    0x2eb5(%rip),%rax
mov    (%rax),%rax
ret
imul   %rdi,%rsi
sar    $0x7,%rsi
mov    %rsi,%rdi
jmp    1030 <__stdfix_sat_hk@plt>

LLVM IR (-O0):
@INT16_MIN = global i64 0
@INT16_MAX = global i64 0
define i64 @__stdfix_smul_hk(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @INT16_MIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT16_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT16_MAX
store i64 %14, i64* %3
br label %21
15: ; preds = %9, %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = mul nsw i64 %16, %17
%19 = ashr i64 %18, 7
%20 = call i64 @__stdfix_sat_hk(i64 %19)
store i64 %20, i64* %3
br label %21
21: ; preds = %15, %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@INT16_MIN = global i64 0
@INT16_MAX = global i64 0
define i64 @__stdfix_smul_hk(i64 %0, i64 %1) {
%3 = load i64, i64* @INT16_MIN
%4 = icmp eq i64 %3, %0
%5 = icmp eq i64 %3, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* @INT16_MAX
br label %13
9: ; preds = %2
%10 = mul nsw i64 %1, %0
%11 = ashr i64 %10, 7
%12 = tail call i64 @__stdfix_sat_hk(i64 %11)
br label %13
13: ; preds = %9, %7
%14 = phi i64 [ %8, %7 ], [ %12, %9 ]
ret i64 %14
}
unsigned char getCSum(unsigned char *packet) { return packet[9] & 0xf; }


x86 assembly (clang, -O0):
<getCSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCSum>:
mov    0x9(%rdi),%al
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @getCSum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 9
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @getCSum(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 9
%3 = load i8, i8* %2
%4 = and i8 %3, 15
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xcb() {
  Assert_real((isgraph(203) == 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_isgraph.c",
              1020, ("isgraph should be 0 for 0xcb"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xcb>:
push   %rax
mov    $0xcb,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3fc,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xcb\00"
define void @t_isgraph_0xcb() {
%1 = call i64 @isgraph(i32 203)
%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 1020, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xcb\00"
define void @t_isgraph_0xcb() {
%1 = tail call i64 @isgraph(i32 203)
%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 1020, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
void removeExtension(char *path) {
  char *fext = strrchr(path, '.');
  if (fext)
    *fext = 0;
}


x86 assembly (clang, -O0):
<removeExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <removeExtension+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeExtension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <removeExtension+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @removeExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @removeExtension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main_counter(int argc, char **argv) {
  uint64_t i = 0;
  while (i++ < 0xFFFFFFFFFFFFFFFF)
    if (i % 1000000 == 0)
      printf("contando %d\n", i);
}


x86 assembly (clang, -O0):
<main_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cltq
cmp    $0xffffffffffffffff,%rax
jae    1165 <main_counter+0x55>
mov    -0x14(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1160 <main_counter+0x50>
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main_counter+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_counter>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%ebp
mov    $0x1,%ebx
lea    0xedb(%rip),%r14
jmp    1136 <main_counter+0x26>
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x1,%ebx
mov    %ebx,%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
imul   $0xf4240,%eax,%eax
add    %ebp,%eax
jne    1130 <main_counter+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main_counter+0x20>

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

LLVM IR (-O2):
@.str = [13 x i8] c"contando %d\0A\00"
define void @main_counter(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i32 [ 0, %2 ], [ %5, %10 ]
%5 = add nuw nsw i32 %4, 1
%6 = urem i32 %5, 1000000
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %8, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_err(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/transfer.c",
            437, "[ ERROR ] at %s:%d ,err info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/transfer.c",
            437, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x1b5,%r8d
lea    0xf66(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err>:
mov    %rdi,%r9
lea    0xf80(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x1b5,%esi
mov    $0x1b5,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/transfer.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 437, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 437, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/transfer.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 437, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 437, i8* %0)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  unsigned long long tv_usec;
  unsigned long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
unsigned long long nanoClock(void) {
  struct timeval t;
  struct timezone tz;
  gettimeofday(&t, &tz);
  return t.tv_usec + t.tv_sec * 1000000ULL;
}


x86 assembly (clang, -O0):
<nanoClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
imul   $0xf4240,-0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanoClock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i64 @nanoClock() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000
%9 = add i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i64 @nanoClock() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000
%11 = add i64 %10, %7
ret i64 %11
}
/* Variables and functions */
int _DtCvStrCaseCmpLatin1(char const *, char const *);
int _DtHelpCeStrCaseCmpLatin1(const char *s1, const char *s2) {
  return (_DtCvStrCaseCmpLatin1(s1, s2));
}


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

x86 assembly (clang, -O2):
<_DtHelpCeStrCaseCmpLatin1>:
jmp    1030 <_DtCvStrCaseCmpLatin1@plt>

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

LLVM IR (-O2):
define i32 @_DtHelpCeStrCaseCmpLatin1(i8* %0, i8* %1) {
%3 = tail call i32 @_DtCvStrCaseCmpLatin1(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fig07_13() {
  int x;
  int *const ptr = &x;
  printf("x's value is %d", x);
  printf("\n* const ptr's value is %d", *ptr);
  *ptr = 7;
  printf("\n* const ptr's value is %d", *ptr);
}


x86 assembly (clang, -O0):
<fig07_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x7,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig07_13>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"x's value is %d\00"
@.str.1 = [27 x i8] c"\0A* const ptr's value is %d\00"
define void @fig07_13() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %2
store i32 7, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"x's value is %d\00"
@.str.1 = [27 x i8] c"\0A* const ptr's value is %d\00"
define void @fig07_13() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
void INT_Excep_CMTU1_CMT3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMTU1_CMT3() {
ret void
}
int getanum(int x, int y) { return (x + y) * y; }


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

x86 assembly (clang, -O2):
<getanum>:
lea    (%rdi,%rsi,1),%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @getanum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getanum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = mul nsw i32 %3, %1
ret i32 %4
}
void _zf_log_unused(const int dummy, ...) { (void)dummy; }


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

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

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

LLVM IR (-O2):
define void @_zf_log_unused(i32 %0, ...) {
ret void
}
/* Variables and functions */
int intpart_equipartition_chunked(int, int *, int, int);
int intpart_equipartition(int n, int *intpart, int l) {
  return intpart_equipartition_chunked(n, intpart, 1, l);
}


x86 assembly (clang, -O0):
<intpart_equipartition>:
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),%ecx
mov    $0x1,%edx
call   1030 <intpart_equipartition_chunked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intpart_equipartition>:
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <intpart_equipartition_chunked@plt>

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

LLVM IR (-O2):
define i32 @intpart_equipartition(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @intpart_equipartition_chunked(i32 %0, i32* %1, i32 1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void test(uint32_t num) {
  for (int i = 0; i < num; ++i) {
    goto jump;
  }
jump:
  return;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    111f <test+0x1f>
jmp    1124 <test+0x24>
jmp    1124 <test+0x24>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
unsigned short val_get(unsigned short input) {
  if (input <= 32767) {
    return input;
  }
  if (input <= 32775) {
    return reg_read(input);
  }
  vm_fail("Function %s() failed!", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<val_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x7fff,%eax
jg     114b <val_get+0x2b>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1189 <val_get+0x69>
movzwl -0x4(%rbp),%eax
cmp    $0x8007,%eax
jg     116e <val_get+0x4e>
movzwl -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <reg_read@plt>
mov    %ax,-0x2(%rbp)
jmp    1189 <val_get+0x69>
lea    0xe8b(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1030 <vm_fail@plt>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_get>:
push   %rbx
mov    %edi,%ebx
test   %bx,%bx
jns    1156 <val_get+0x36>
movzwl %bx,%eax
cmp    $0x8007,%eax
ja     113f <val_get+0x1f>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <reg_read@plt>
mov    %eax,%ebx
jmp    1156 <val_get+0x36>
lea    0xeba(%rip),%rdi
lea    0xec9(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <vm_fail@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Function %s() failed!\00"
@__FUNCTION__.val_get = [8 x i8] c"val_get\00"
define zeroext i16 @val_get(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp sle i32 %5, 32767
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i16, i16* %3
store i16 %8, i16* %2
br label %20
9: ; preds = %1
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = icmp sle i32 %11, 32775
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = call i32 (i32, ...) bitcast (i32 (...)* @reg_read to i32 (i32, ...)*)(i32 %15)
%17 = trunc i32 %16 to i16
store i16 %17, i16* %2
br label %20
18: ; preds = %9
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @vm_fail to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.val_get, i64 0, i64 0))
store i16 0, i16* %2
br label %20
20: ; preds = %18, %13, %7
%21 = load i16, i16* %2
ret i16 %21
}

LLVM IR (-O2):
@.str = [22 x i8] c"Function %s() failed!\00"
@__FUNCTION__.val_get = [8 x i8] c"val_get\00"
define zeroext i16 @val_get(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = icmp sgt i16 %0, -1
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = icmp ult i16 %0, -32760
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @reg_read to i32 (i32, ...)*)(i32 %2)
%8 = trunc i32 %7 to i16
br label %11
9: ; preds = %4
%10 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @vm_fail to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.val_get, i64 0, i64 0))
br label %11
11: ; preds = %1, %9, %6
%12 = phi i16 [ %8, %6 ], [ 0, %9 ], [ %0, %1 ]
ret i16 %12
}
/* Variables and functions */
int ENODEV;
int qpnp_config_s2_enable(int pon_type, int en) { return -ENODEV; }


x86 assembly (clang, -O0):
<qpnp_config_s2_enable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecd(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @qpnp_config_s2_enable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %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 @qpnp_config_s2_enable(i32 %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
int sd_zbc_revalidate_zones(struct scsi_disk *sdkp) { return 0; }


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

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

LLVM IR (-O0):
%struct.scsi_disk = type opaque
define i32 @sd_zbc_revalidate_zones(%struct.scsi_disk* %0) {
%2 = alloca %struct.scsi_disk*
store %struct.scsi_disk* %0, %struct.scsi_disk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.scsi_disk = type opaque
define i32 @sd_zbc_revalidate_zones(%struct.scsi_disk* nocapture readnone %0) {
ret i32 0
}
void xtalosc_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @xtalosc_iomux_config() {
ret void
}
/* Variables and functions */
unsigned char EP94M3_I2C_Reg_Rd(unsigned char, unsigned char *, unsigned int);
unsigned char EP94M0_Reg_Read(unsigned char RegAddr, unsigned char *Data,
                              unsigned int Size) {
  return EP94M3_I2C_Reg_Rd(RegAddr, Data, Size);
}


x86 assembly (clang, -O0):
<EP94M0_Reg_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movzbl %al,%edi
call   1030 <EP94M3_I2C_Reg_Rd@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EP94M0_Reg_Read>:
jmp    1030 <EP94M3_I2C_Reg_Rd@plt>

LLVM IR (-O0):
define zeroext i8 @EP94M0_Reg_Read(i8 zeroext %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
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call zeroext i8 @EP94M3_I2C_Reg_Rd(i8 zeroext %7, i8* %8, i32 %9)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @EP94M0_Reg_Read(i8 zeroext %0, i8* %1, i32 %2) {
%4 = tail call zeroext i8 @EP94M3_I2C_Reg_Rd(i8 zeroext %0, i8* %1, i32 %2)
ret i8 %4
}
int nop_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nop_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AdcHardware_Init();
void AdcConductor_Init(void) { AdcHardware_Init(); }


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

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

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

LLVM IR (-O2):
define void @AdcConductor_Init() {
%1 = tail call i32 (...) @AdcHardware_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LengthVec3_init(void) {
  _hmt_register_covercase("HMM_LengthVec3", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LengthVec3_init>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"HMM_LengthVec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LengthVec3_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stats_updatebyidx_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stats@%p::updatebyidx (rtpp_stats_updatebyidx) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stats_updatebyidx_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stats_updatebyidx_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stats@%p::updatebyidx (rtpp_stats_updatebyidx) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyidx_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stats@%p::updatebyidx (rtpp_stats_updatebyidx) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyidx_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ normal();
int main(void) {
  normal();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @normal()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void showInput(char *arg) {
  char buffer[1024];
  strcpy(buffer, arg);
  puts("IN DEP/ASLR WE TRUST!");
}


x86 assembly (clang, -O0):
<showInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showInput>:
sub    $0x408,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"IN DEP/ASLR WE TRUST!\00"
define void @showInput(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"IN DEP/ASLR WE TRUST!\00"
define void @showInput(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
int bool(int n) {
  int flag;
  if (n < -2147483647)
    flag = 1;
  else
    flag = 0;
  return (flag);
}


x86 assembly (clang, -O0):
<bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80000001,-0x4(%rbp)
jge    1120 <bool+0x20>
movl   $0x1,-0x8(%rbp)
jmp    1127 <bool+0x27>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool>:
xor    %eax,%eax
cmp    $0x80000000,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @bool(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f182(int *);
int f183(int *p) { return f182(p); }


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

x86 assembly (clang, -O2):
<f183>:
jmp    1030 <f182@plt>

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

LLVM IR (-O2):
define i32 @f183(i32* %0) {
%2 = tail call i32 @f182(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _a64_outb(int, int);
void i8259pic_mask_all_interrupts() {
  _a64_outb(0x21, 0xFF);
  _a64_outb(0xA1, 0xFF);
}


x86 assembly (clang, -O0):
<i8259pic_mask_all_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <_a64_outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <_a64_outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8259pic_mask_all_interrupts>:
push   %rax
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <_a64_outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <_a64_outb@plt>

LLVM IR (-O0):
define void @i8259pic_mask_all_interrupts() {
%1 = call i32 @_a64_outb(i32 33, i32 255)
%2 = call i32 @_a64_outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @i8259pic_mask_all_interrupts() {
%1 = tail call i32 @_a64_outb(i32 33, i32 255)
%2 = tail call i32 @_a64_outb(i32 161, i32 255)
ret void
}
char *langRomTypeJisyo() { return "Jisyo"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Jisyo\00"
define i8* @langRomTypeJisyo() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_word_format();
void usage(const char *x) {
  fprintf(stderr, "Usage: %s -t|-x [-v] [-7] [-Wformat] [-f file]\n", x);
  usage_word_format();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s -t|-x [-v] [-7] [-Wformat] [-f file]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @usage_word_format()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s -t|-x [-v] [-7] [-Wformat] [-f file]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @usage_word_format()
%5 = tail call i32 @exit(i32 1)
unreachable
}