xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("\n%d", a * a);
  printf("\n%d", a * a * a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void rd_init(int mem_start, int length) {
  int i;
  char *cp;
  cp = (char *)mem_start;
  for (i = 0; i < length; i++)
    *cp++ = 'h';
}


x86 assembly (clang, -O0):
<rd_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1145 <rd_init+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x68,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <rd_init+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_init>:
test   %esi,%esi
jle    1128 <rd_init+0x18>
push   %rax
movslq %edi,%rdi
mov    %esi,%edx
mov    $0x68,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @rd_init(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rnd_avg32(uint32_t a, uint32_t b) {
  return (a | b) - (((a ^ b) & ~((0x01) * 0x01010101UL)) >> 1);
}


x86 assembly (clang, -O0):
<rnd_avg32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
cltq
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0xfffffffffefefefe,%rcx
shr    $0x1,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_avg32>:
mov    %esi,%eax
or     %edi,%eax
xor    %edi,%esi
sar    %esi
and    $0xff7f7f7f,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @rnd_avg32(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 = or i32 %5, %6
%8 = sext i32 %7 to i64
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
%12 = sext i32 %11 to i64
%13 = and i64 %12, -16843010
%14 = lshr i64 %13, 1
%15 = sub i64 %8, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @rnd_avg32(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %1, %0
%5 = ashr i32 %4, 1
%6 = and i32 %5, -8421505
%7 = sub i32 %3, %6
ret i32 %7
}
void lm_dump_linesim_power(float tx_db, float rx_db, float noise_db) {}


x86 assembly (clang, -O0):
<lm_dump_linesim_power>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lm_dump_linesim_power(float %0, float %1, float %2) {
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_get_8(struct buffer *);
void buffer_get_n(struct buffer *self, int n, char *dst) {
  int i;
  for (i = 0; i < n; i++)
    *dst++ = buffer_get_8(self);
}


x86 assembly (clang, -O0):
<buffer_get_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <buffer_get_n+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <buffer_get_8@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <buffer_get_n+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_get_n>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <buffer_get_n+0x35>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <buffer_get_8@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <buffer_get_n+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_get_n(%struct.buffer* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = phi i8* [ %10, %5 ], [ %2, %3 ]
%8 = tail call i32 @buffer_get_8(%struct.buffer* %0)
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_stats(char *cmd) { printw("\n\rstats command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0Dstats command\0A\0D\0A\0D\00"
define void @ion_cmd_stats(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A\0Dstats command\0A\0D\0A\0D\00"
define void @ion_cmd_stats(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void exit_irq_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_irq_thread() {
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
bool kw_ident_end(char c) { return !(isalnum(c) || c == '_'); }


x86 assembly (clang, -O0):
<kw_ident_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <kw_ident_end+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kw_ident_end>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
sete   %al
cmp    $0x5f,%bl
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kw_ident_end(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @kw_ident_end(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = icmp ne i8 %0, 95
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int remote_help(const char *device, int argc, char *argv[]) {
  printf("Access the remote node and link lists.\n");
  printf("Commands supported: <nodes | links> <list | add | remove>\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Access the remote node and link lists.\0A\00"
@.str.1 = [59 x i8] c"Commands supported: <nodes | links> <list | add | remove>\0A\00"
define i32 @remote_help(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Access the remote node and link lists.\00"
@str.2 = [58 x i8] c"Commands supported: <nodes | links> <list | add | remove>\00"
define i32 @remote_help(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ optind;
int /*<<< orphan*/ read_archive(int /*<<< orphan*/, int, char **, char, int);
void delete (int index, int argc, char **argv, int verbose) {
  read_archive(optind, argc, argv, 'd', verbose);
}


x86 assembly (clang, -O0):
<delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%r8d
mov    $0x64,%ecx
call   1030 <read_archive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
mov    %ecx,%r8d
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    $0x64,%ecx
jmp    1030 <read_archive@plt>

LLVM IR (-O0):
@optind = global i32 0
define void @delete(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* @optind
%10 = load i32, i32* %6
%11 = load i8**, i8*** %7
%12 = load i32, i32* %8
%13 = call i32 @read_archive(i32 %9, i32 %10, i8** %11, i8 signext 100, i32 %12)
ret void
}

LLVM IR (-O2):
@optind = global i32 0
define void @delete(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = load i32, i32* @optind
%6 = tail call i32 @read_archive(i32 %5, i32 %1, i8** %2, i8 signext 100, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_strcpy(char *, char *);
int main(void) {
  char tmp1[16] = "aaaaazzzzzeeeee";
  char tmp2[16] = "---------------";
  my_strcpy(tmp1, tmp2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <my_strcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <my_strcpy@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.tmp1 = [16 x i8] c"aaaaazzzzzeeeee\00"
@__const.main.tmp2 = [16 x i8] c"---------------\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
%5 = bitcast [16 x i8]* %3 to i8*
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @my_strcpy(i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tmp1 = [16 x i8] c"aaaaazzzzzeeeee\00"
@__const.main.tmp2 = [16 x i8] c"---------------\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @my_strcpy(i8* %3, i8* %4)
ret i32 0
}
int iscsiAuthClientCheckChapAlgorithmList(unsigned int optionCount,
                                          const int *optionList) {
  if (!optionList || optionCount < 1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iscsiAuthClientCheckChapAlgorithmList>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <iscsiAuthClientCheckChapAlgorithmList+0x20>
cmpl   $0x1,-0x8(%rbp)
jae    112c <iscsiAuthClientCheckChapAlgorithmList+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <iscsiAuthClientCheckChapAlgorithmList+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscsiAuthClientCheckChapAlgorithmList>:
test   %rsi,%rsi
sete   %al
test   %edi,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscsiAuthClientCheckChapAlgorithmList(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ult i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 1, i32* %3
br label %13
12: ; preds = %8
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @iscsiAuthClientCheckChapAlgorithmList(i32 %0, i32* readnone %1) {
%3 = icmp eq i32* %1, null
%4 = icmp eq i32 %0, 0
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ LeslieStrcpy(char *, char *);
int /*<<< orphan*/ log_message(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char buf[80] = {'\0'};
  LeslieStrcpy(buf, "111.28.11.12");
  printf("%s\n", buf);
  log_message("zhaixiang");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <LeslieStrcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
call   1050 <log_message@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xea9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <LeslieStrcpy@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1040 <log_message@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"111.28.11.12\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [10 x i8] c"zhaixiang\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [80 x i8]* %6 to i8*
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = call i32 @LeslieStrcpy(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @log_message(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"111.28.11.12\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [10 x i8] c"zhaixiang\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @LeslieStrcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @log_message(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int __ltullong(unsigned long long a, unsigned long long b) { return a < b; }


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

x86 assembly (clang, -O2):
<__ltullong>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @__ltullong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ltullong(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
_Bool F4(_Bool B1, _Bool B2) {
  _Bool R = 0;
  if (B1 || B2)
    ;
  else
    R = 1;
  return R;
}


x86 assembly (clang, -O0):
<F4>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
testb  $0x1,-0x1(%rbp)
jne    112d <F4+0x2d>
testb  $0x1,-0x2(%rbp)
je     1132 <F4+0x32>
jmp    1136 <F4+0x36>
movb   $0x1,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F4>:
mov    %edi,%eax
or     %esi,%eax
xor    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @F4(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = zext i1 %0 to i8
store i8 %6, i8* %3
%7 = zext i1 %1 to i8
store i8 %7, i8* %4
store i8 0, i8* %5
%8 = load i8, i8* %3
%9 = trunc i8 %8 to i1
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8, i8* %4
%12 = trunc i8 %11 to i1
br i1 %12, label %13, label %14
13: ; preds = %10, %2
br label %15
14: ; preds = %10
store i8 1, i8* %5
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %5
%17 = trunc i8 %16 to i1
ret i1 %17
}

LLVM IR (-O2):
define zeroext i1 @F4(i1 zeroext %0, i1 zeroext %1) {
%3 = or i1 %0, %1
%4 = xor i1 %3, true
ret i1 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __STREXW(uint32_t value,
                                           volatile uint32_t *addr) {
  uint32_t result;
  return (result);
}


x86 assembly (clang, -O0):
<__STREXW>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__STREXW(i32 %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
unsigned long long __bextri_u64(unsigned long long, int);
unsigned long long test__bextri_u64(unsigned long long a) {
  return __bextri_u64(a, 2);
}


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

x86 assembly (clang, -O2):
<test__bextri_u64>:
mov    $0x2,%esi
jmp    1030 <__bextri_u64@plt>

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

LLVM IR (-O2):
define i64 @test__bextri_u64(i64 %0) {
%2 = tail call i64 @__bextri_u64(i64 %0, i32 2)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("hello, world"); }


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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int strlen(char const *);
int write(int, char const *, int);
void do_write(int fd, const char *buf) {
  int len = strlen(buf);
  if (write(fd, buf, len) != len)
    err(EX_SOFTWARE, "Could not write to output file");
}


x86 assembly (clang, -O0):
<do_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     1178 <do_write+0x48>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1050 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    %ebp,%eax
jne    115a <do_write+0x2a>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <err@plt>

LLVM IR (-O0):
@EX_SOFTWARE = global i32 0
@.str = [31 x i8] c"Could not write to output file\00"
define void @do_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
%12 = load i32, i32* %5
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* @EX_SOFTWARE
%16 = call i32 @err(i32 %15, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
@EX_SOFTWARE = global i32 0
@.str = [31 x i8] c"Could not write to output file\00"
define void @do_write(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, %3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @err(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[]) {
  int subject_code = 909;
  int total_mark = 100;
  float obtain_mark;
  printf("Examination's subject is %d.\n", subject_code);
  printf("Total Mark: %d \n ", total_mark);
  printf("Obtain Mark: %f \n", obtain_mark);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x38d,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Examination's subject is %d.\0A\00"
@.str.1 = [18 x i8] c"Total Mark: %d \0A \00"
@.str.2 = [18 x i8] c"Obtain Mark: %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 909, i32* %6
store i32 100, i32* %7
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to float
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %13)
%15 = load float, float* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Examination's subject is %d.\0A\00"
@.str.1 = [18 x i8] c"Total Mark: %d \0A \00"
@.str.2 = [18 x i8] c"Obtain Mark: %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float 9.090000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float 1.000000e+02)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float undef)
ret i32 0
}
unsigned kol_mouse_posw() { asm volatile("int $0x40" ::"a"(37), "b"(1)); }


x86 assembly (clang, -O0):
<kol_mouse_posw>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_posw>:
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_mouse_posw() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 1)
ret i32 undef
}
__attribute__((weak)) int _lseek(int file, int offset, int whence) {
  file = file;
  offset = offset;
  whence = whence;
  return -1;
}


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

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

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

LLVM IR (-O2):
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int strlen(char const *);
int validate_repository_type(const char *type) {
  if (type == NULL) {
    return -1;
  }
  if (strlen(type) > 3) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validate_repository_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_repository_type+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <validate_repository_type+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jle    1151 <validate_repository_type+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <validate_repository_type+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_repository_type>:
test   %rdi,%rdi
je     112c <validate_repository_type+0x1c>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
setge  %al
neg    %eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @validate_repository_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = icmp sgt i32 %9, 3
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @validate_repository_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 3
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: getpin value_path\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: getpin value_path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: getpin value_path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
void write_identifier(char *array, int id) {
  void *temp = &id;
  memcpy(array + 0, temp, 4);
  memcpy(array + 4, temp, 4);
  memcpy(array + 8, temp, 4);
}


x86 assembly (clang, -O0):
<write_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_identifier>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x4(%rbx),%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x8,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @write_identifier(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 4)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = load i8*, i8** %5
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 4)
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 8
%17 = load i8*, i8** %5
%18 = call i32 @memcpy(i8* %16, i8* %17, i32 4)
ret void
}

LLVM IR (-O2):
define void @write_identifier(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = call i32 @memcpy(i8* %6, i8* %4, i32 4)
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = call i32 @memcpy(i8* %8, i8* %4, i32 4)
ret void
}
/* Variables and functions */
double sin(double);
__attribute__((always_)) double drmp3_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<drmp3_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @drmp3_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
void setup() {
  mkdir("writeable", 0777);
  mkdir("unwriteable", 0111);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee7(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
lea    0xed4(%rip),%rdi
mov    $0x49,%esi
call   1030 <mkdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
lea    0xeea(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
lea    0xed7(%rip),%rdi
mov    $0x49,%esi
pop    %rax
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"writeable\00"
@.str.1 = [12 x i8] c"unwriteable\00"
define void @setup() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = call i32 @mkdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 73)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"writeable\00"
@.str.1 = [12 x i8] c"unwriteable\00"
define void @setup() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = tail call i32 @mkdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 73)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc1() {
  Assert_real((isalpha(193) == 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_isalpha.c",
              970, ("isalpha should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc1\00"
define void @t_isalpha_0xc1() {
%1 = call i64 @isalpha(i32 193)
%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 970, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc1\00"
define void @t_isalpha_0xc1() {
%1 = tail call i64 @isalpha(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
OP(fd, c3) { op_c3(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c3()
ret i32 undef
}
/* Variables and functions */
int yas_mma8453q_read_reg_byte(int);
int /*<<< orphan*/ yas_mma8453q_write_reg_byte(int, int);
int yas_mma8453q_power_down(void) {
  yas_mma8453q_write_reg_byte(
      0x0f, ((yas_mma8453q_read_reg_byte(0x0f) & ~0x10) | ((0) << 4)));
  yas_mma8453q_write_reg_byte(
      0x2a, ((yas_mma8453q_read_reg_byte(0x2a) & ~0x01) | ((0) << 0)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_mma8453q_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <yas_mma8453q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x0,%esi
mov    $0xf,%edi
call   1040 <yas_mma8453q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1030 <yas_mma8453q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xfffffffe,%esi
or     $0x0,%esi
mov    $0x2a,%edi
call   1040 <yas_mma8453q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_mma8453q_power_down>:
push   %rax
mov    $0xf,%edi
call   1030 <yas_mma8453q_read_reg_byte@plt>
and    $0xffffffef,%eax
mov    $0xf,%edi
mov    %eax,%esi
call   1040 <yas_mma8453q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1030 <yas_mma8453q_read_reg_byte@plt>
and    $0xfffffffe,%eax
mov    $0x2a,%edi
mov    %eax,%esi
call   1040 <yas_mma8453q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_mma8453q_power_down() {
%1 = call i32 @yas_mma8453q_read_reg_byte(i32 15)
%2 = and i32 %1, -17
%3 = or i32 %2, 0
%4 = call i32 @yas_mma8453q_write_reg_byte(i32 15, i32 %3)
%5 = call i32 @yas_mma8453q_read_reg_byte(i32 42)
%6 = and i32 %5, -2
%7 = or i32 %6, 0
%8 = call i32 @yas_mma8453q_write_reg_byte(i32 42, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_mma8453q_power_down() {
%1 = tail call i32 @yas_mma8453q_read_reg_byte(i32 15)
%2 = and i32 %1, -17
%3 = tail call i32 @yas_mma8453q_write_reg_byte(i32 15, i32 %2)
%4 = tail call i32 @yas_mma8453q_read_reg_byte(i32 42)
%5 = and i32 %4, -2
%6 = tail call i32 @yas_mma8453q_write_reg_byte(i32 42, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, ...);
int write_real(char *out, double in, size_t n) {
  if (in == 0) {
    snprintf(out, n, "0");
    return 0;
  }
  snprintf(out, n, "%g", in);
  return 0;
}


x86 assembly (clang, -O0):
<write_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115f <write_real+0x4f>
jp     115f <write_real+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    0xeb4(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1181 <write_real+0x71>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdx
mov    $0x1,%al
call   1030 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_real>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112d <write_real+0x1d>
jp     112d <write_real+0x1d>
lea    0xedc(%rip),%rdx
xor    %eax,%eax
call   1030 <snprintf@plt>
jmp    113b <write_real+0x2b>
lea    0xece(%rip),%rdx
mov    $0x1,%al
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"%g\00"
define i32 @write_real(i8* %0, double %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double
%7 = alloca i64
store i8* %0, i8** %5
store double %1, double* %6
store i64 %2, i64* %7
%8 = load double, double* %6
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i64, i64* %7
%13 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %19
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i64, i64* %7
%17 = load double, double* %6
%18 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %15, i64 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %17)
store i32 0, i32* %4
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"%g\00"
define i32 @write_real(i8* nocapture writeonly %0, double %1, i64 %2) {
%4 = fcmp oeq double %1, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %1)
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chown(char *, unsigned long, unsigned long);
int /*<<< orphan*/ error_msg_and_die(char *, char *);
scalar_t__ mknod(char *, unsigned long, int /*<<< orphan*/);
void add_new_fifo(char *name, char *path, unsigned long uid, unsigned long gid,
                  unsigned long mode) {
  if (mknod(path, mode, 0))
    error_msg_and_die("%s: file can not be created with mknod!", path);
  chown(path, uid, gid);
}


x86 assembly (clang, -O0):
<add_new_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1040 <mknod@plt>
cmp    $0x0,%rax
je     1175 <add_new_fifo+0x45>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <error_msg_and_die@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <chown@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_new_fifo>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rsi,%rdi
mov    %r8,%rsi
xor    %edx,%edx
call   1040 <mknod@plt>
test   %rax,%rax
je     115f <add_new_fifo+0x2f>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <error_msg_and_die@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <chown@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%s: file can not be created with mknod!\00"
define void @add_new_fifo(i8* %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %7
%12 = load i64, i64* %10
%13 = call i64 @mknod(i8* %11, i64 %12, i32 0)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %5
%16 = load i8*, i8** %7
%17 = call i32 @error_msg_and_die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %5
%19 = load i8*, i8** %7
%20 = load i64, i64* %8
%21 = load i64, i64* %9
%22 = call i32 @chown(i8* %19, i64 %20, i64 %21)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s: file can not be created with mknod!\00"
define void @add_new_fifo(i8* nocapture readnone %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @mknod(i8* %1, i64 %4, i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @error_msg_and_die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @chown(i8* %1, i64 %2, i64 %3)
ret void
}