xunge/DecIR huggingface dataset:
/* Variables and functions */
char input();
void comment() {
  char c1, c2;
loop:
  while ((c1 = input()) != '*' && c1 != 0)
    ;
  if ((c2 = input()) != '/' && c1 != 0)
    goto loop;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <comment+0xd>
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0x3(%rbp)
je     1145 <comment+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    1155 <comment+0x45>
jmp    115a <comment+0x4a>
jmp    111d <comment+0xd>
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
cmp    $0x2f,%eax
je     1182 <comment+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1182 <comment+0x72>
jmp    1118 <comment+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
cmp    $0x2a,%al
je     1131 <comment+0x21>
test   %bl,%bl
jne    1120 <comment+0x10>
xor    %eax,%eax
call   1030 <input@plt>
cmp    $0x2f,%al
je     1140 <comment+0x30>
test   %bl,%bl
jne    1120 <comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @comment() {
%1 = alloca i8
%2 = alloca i8
br label %3
3: ; preds = %23, %0
br label %4
4: ; preds = %14, %3
%5 = call signext i8 (...) @input()
store i8 %5, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 42
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = call signext i8 (...) @input()
store i8 %16, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 47
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %1
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
br label %3
24: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define void @comment() {
br label %1
1: ; preds = %3, %0
%2 = tail call signext i8 (...) @input()
switch i8 %2, label %3 [
i8 42, label %4
i8 0, label %4
]
3: ; preds = %1, %4
br label %1
4: ; preds = %1, %1
%5 = icmp ne i8 %2, 0
%6 = tail call signext i8 (...) @input()
%7 = icmp ne i8 %6, 47
%8 = select i1 %7, i1 %5, i1 false
br i1 %8, label %3, label %9
9: ; preds = %4
ret void
}
void freeChannelArray(char **array) {
  for (unsigned i = 0; i < 5; ++i)
    free(array[i]);
  free(array);
}


x86 assembly (clang, -O0):
<freeChannelArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jae    114b <freeChannelArray+0x3b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeChannelArray+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeChannelArray>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeChannelArray(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = getelementptr inbounds i8*, i8** %0, i64 2
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = getelementptr inbounds i8*, i8** %0, i64 3
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = getelementptr inbounds i8*, i8** %0, i64 4
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = bitcast i8** %0 to i8*
tail call void @free(i8* %11)
ret void
}
int test_imm_B1int16_reg(short val) {
  return ((val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B1int16_reg(i16 signext %0) {
%2 = and i16 %0, 177
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__2__IO__clr();
void LedsP__Led0__clr(void) { HplAtm128GeneralIOPinP__2__IO__clr(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__2__IO__clr()
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *__machdep_stack_alloc(size_t size) {
  void *stack;
  return (malloc(size));
}


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

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

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

LLVM IR (-O2):
define noalias i8* @__machdep_stack_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
int my_rev_params(int argc, char *argv[]) {
  while ((argc - 1) > 0) {
    my_putstr(argv[argc]);
    my_putchar('\n');
  }
}


x86 assembly (clang, -O0):
<my_rev_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jle    115e <my_rev_params+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
jmp    112f <my_rev_params+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rev_params>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <my_rev_params+0x25>
mov    %rsi,%r14
mov    %edi,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
jmp    1130 <my_rev_params+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @my_rev_params(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i8*, i8** %1, i64 %5
br label %7
7: ; preds = %7, %4
%8 = load i8*, i8** %6
%9 = tail call i32 @my_putstr(i8* %8)
%10 = tail call i32 @my_putchar(i8 signext 10)
br label %7
11: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ nop();
int two_loops_symb(int m) {
  int p = 10;
  for (int i = 0; i < m; i++) {
    nop();
  }
  for (int j = 0; j < m; j++) {
    nop();
  }
  return p;
}


x86 assembly (clang, -O0):
<two_loops_symb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114a <two_loops_symb+0x3a>
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <two_loops_symb+0x19>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <two_loops_symb+0x62>
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <two_loops_symb+0x41>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_loops_symb>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    113c <two_loops_symb+0x2c>
mov    %edi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nop@plt>
add    $0xffffffff,%ebp
jne    1120 <two_loops_symb+0x10>
test   %ebx,%ebx
jle    113c <two_loops_symb+0x2c>
xor    %eax,%eax
call   1030 <nop@plt>
add    $0xffffffff,%ebx
jne    1130 <two_loops_symb+0x20>
mov    $0xa,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @two_loops_symb(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %9
3: ; preds = %4
br i1 %2, label %10, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @nop()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
9: ; preds = %10, %1, %3
ret i32 10
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 (...) @nop()
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %9, label %10
}
/* Type definitions */
struct delete_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int delete_cmdline_parser_required(struct delete_args_info *args_info,
                                   const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<delete_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.delete_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @delete_cmdline_parser_required(%struct.delete_args_info* %0, i8* %1) {
%3 = alloca %struct.delete_args_info*
%4 = alloca i8*
store %struct.delete_args_info* %0, %struct.delete_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.delete_args_info*, %struct.delete_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.delete_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @delete_cmdline_parser_required(%struct.delete_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int base26toInt(char *buffer) {
  char c;
  int result = 0;
  while ((c = *buffer++) > 0) {
    if (c < 'A' || 'Z' < c)
      return -1;
    result = result * 26 + (c - 'A');
  }
  return result;
}


x86 assembly (clang, -O0):
<base26toInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jle    116e <base26toInt+0x6e>
movsbl -0x11(%rbp),%eax
cmp    $0x41,%eax
jl     114d <base26toInt+0x4d>
movsbl -0x11(%rbp),%ecx
mov    $0x5a,%eax
cmp    %ecx,%eax
jge    1159 <base26toInt+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <base26toInt+0x74>
imul   $0x1a,-0x18(%rbp),%eax
movsbl -0x11(%rbp),%ecx
sub    $0x41,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    110f <base26toInt+0xf>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base26toInt>:
mov    (%rdi),%cl
test   %cl,%cl
jle    1135 <base26toInt+0x35>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    -0x5b(%rcx),%edx
cmp    $0xe6,%dl
jb     1138 <base26toInt+0x38>
movzbl %cl,%ecx
lea    (%rax,%rax,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0xffffffbf,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jg     1110 <base26toInt+0x10>
ret
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @base26toInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %11
%5 = phi i8 [ %16, %11 ], [ %2, %1 ]
%6 = phi i8* [ %8, %11 ], [ %0, %1 ]
%7 = phi i32 [ %15, %11 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nsw i8 %5, -91
%10 = icmp ult i8 %9, -26
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = zext i8 %5 to i32
%13 = mul nsw i32 %7, 26
%14 = add i32 %13, -65
%15 = add i32 %14, %12
%16 = load i8, i8* %8
%17 = icmp sgt i8 %16, 0
br i1 %17, label %4, label %18
18: ; preds = %4, %11, %1
%19 = phi i32 [ 0, %1 ], [ %15, %11 ], [ -1, %4 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ int8_t;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__, int /*<<< orphan*/ *, int);
void ptr_set_int8_t(void *arg1, int offset, int8_t value) {
  memcpy((caddr_t)arg1 + offset, &value, sizeof(value));
}


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

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

LLVM IR (-O0):
define void @ptr_set_int8_t(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = call i32 @memcpy(i64 %11, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @ptr_set_int8_t(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(i64 %7, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
g(char *p) { printf("g(%p) = %d\n", p, *p); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rdi
movsbl (%rax),%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rsi
movsbl (%rdi),%edx
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"g(%p) = %d\0A\00"
define i32 @g(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %2)
ret i32 undef
}
long int fn4(long int x, unsigned long y) { return x << y; }


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

x86 assembly (clang, -O2):
<fn4>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @fn4(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 = shl i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @fn4(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
ret i64 %3
}
void XtAddActions() {}


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

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

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

LLVM IR (-O2):
define void @XtAddActions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
extern void extractlib_die(const char *msg) {
  fprintf(stderr, "%s: %s\n", "extract", msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<extractlib_die>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecd(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [8 x i8] c"extract\00"
define void @extractlib_die(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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [8 x i8] c"extract\00"
define void @extractlib_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int list_swap(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
bool test_list_swap_null_params(void) {
  bool pass = false;
  unsigned int res = list_swap(0, 1, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_swap_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <list_swap@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1143 <test_list_swap_null_params+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_swap_null_params>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <list_swap@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_swap_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_swap(i32 0, i32 1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_swap_null_params() {
%1 = tail call i32 @list_swap(i32 0, i32 1, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *infix_to_postfix_conv(char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char *string = "a + b * c + (d * c + f) * g";
  char *output = infix_to_postfix_conv(string);
  puts(output);
  free(output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <infix_to_postfix_conv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <infix_to_postfix_conv@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"a + b * c + (d * c + f) * g\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @infix_to_postfix_conv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"a + b * c + (d * c + f) * g\00"
define i32 @main() {
%1 = tail call i8* @infix_to_postfix_conv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
void sdo_set_segment_size(struct can_frame *frame, size_t size) {
  int n = 7 - size;
  frame->data[0] &= ~(7 << 1);
  frame->data[0] |= n << 1;
}


x86 assembly (clang, -O0):
<sdo_set_segment_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7,%eax
sub    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
and    $0xfffffff1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_set_segment_size>:
mov    (%rdi),%rax
mov    (%rax),%ecx
and    $0xfffffff1,%ecx
add    %esi,%esi
mov    $0xe,%edx
sub    %esi,%edx
or     %ecx,%edx
mov    %edx,(%rax)
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_set_segment_size(%struct.can_frame* %0, i64 %1) {
%3 = alloca %struct.can_frame*
%4 = alloca i64
%5 = alloca i32
store %struct.can_frame* %0, %struct.can_frame** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 7, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load %struct.can_frame*, %struct.can_frame** %3
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = and i32 %13, -15
store i32 %14, i32* %12
%15 = load i32, i32* %5
%16 = shl i32 %15, 1
%17 = load %struct.can_frame*, %struct.can_frame** %3
%18 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %17, i32 0, i32 0
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = or i32 %21, %16
store i32 %22, i32* %20
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_set_segment_size(%struct.can_frame* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = and i32 %6, -15
%8 = mul i32 %3, -2
%9 = add i32 %8, 14
%10 = or i32 %7, %9
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int /*<<< orphan*/ yas_bma250_write_reg_byte(int, int);
int yas_bma250_power_up(void) {
  yas_bma250_write_reg_byte(
      0x17, ((yas_bma250_read_reg_byte(0x17) & ~0x10) | ((1) << 4)));
  yas_bma250_write_reg_byte(
      0x11, ((yas_bma250_read_reg_byte(0x11) & ~0xc0) | ((1) << 6)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_bma250_power_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x10,%esi
mov    $0x17,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffff3f,%esi
or     $0x40,%esi
mov    $0x11,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_power_up>:
push   %rax
mov    $0x17,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
or     $0x10,%eax
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
and    $0xffffff3f,%eax
lea    0x40(%rax),%esi
mov    $0x11,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_bma250_power_up() {
%1 = call i32 @yas_bma250_read_reg_byte(i32 23)
%2 = and i32 %1, -17
%3 = or i32 %2, 16
%4 = call i32 @yas_bma250_write_reg_byte(i32 23, i32 %3)
%5 = call i32 @yas_bma250_read_reg_byte(i32 17)
%6 = and i32 %5, -193
%7 = or i32 %6, 64
%8 = call i32 @yas_bma250_write_reg_byte(i32 17, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_bma250_power_up() {
%1 = tail call i32 @yas_bma250_read_reg_byte(i32 23)
%2 = or i32 %1, 16
%3 = tail call i32 @yas_bma250_write_reg_byte(i32 23, i32 %2)
%4 = tail call i32 @yas_bma250_read_reg_byte(i32 17)
%5 = and i32 %4, -193
%6 = or i32 %5, 64
%7 = tail call i32 @yas_bma250_write_reg_byte(i32 17, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52_get_frmsizecod(const uint8_t *p_a52) { return p_a52[4] & 0x3f; }


x86 assembly (clang, -O0):
<a52_get_frmsizecod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_get_frmsizecod>:
mov    0x10(%rdi),%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @a52_get_frmsizecod(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 63
ret i32 %6
}

LLVM IR (-O2):
define i32 @a52_get_frmsizecod(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = and i32 %3, 63
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_list_append();
int /*<<< orphan*/ test_list_construct();
int /*<<< orphan*/ test_list_prepend();
void test_all(void) {
  test_list_construct();
  test_list_append();
  test_list_prepend();
}


x86 assembly (clang, -O0):
<test_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_list_construct@plt>
mov    $0x0,%al
call   1050 <test_list_append@plt>
mov    $0x0,%al
call   1040 <test_list_prepend@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all>:
push   %rax
xor    %eax,%eax
call   1030 <test_list_construct@plt>
xor    %eax,%eax
call   1050 <test_list_append@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_list_prepend@plt>

LLVM IR (-O0):
define void @test_all() {
%1 = call i32 (...) @test_list_construct()
%2 = call i32 (...) @test_list_append()
%3 = call i32 (...) @test_list_prepend()
ret void
}

LLVM IR (-O2):
define void @test_all() {
%1 = tail call i32 (...) @test_list_construct()
%2 = tail call i32 (...) @test_list_append()
%3 = tail call i32 (...) @test_list_prepend()
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ preorderBST(struct node *, int *, int);
void preorder(struct node *root, int *arr) { preorderBST(root, arr, 1); }


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
define void @preorder(%struct.node* %0, i32* %1) {
%3 = alloca %struct.node*
%4 = alloca i32*
store %struct.node* %0, %struct.node** %3
store i32* %1, i32** %4
%5 = load %struct.node*, %struct.node** %3
%6 = load i32*, i32** %4
%7 = call i32 @preorderBST(%struct.node* %5, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @preorder(%struct.node* %0, i32* %1) {
%3 = tail call i32 @preorderBST(%struct.node* %0, i32* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jpg1byte();
unsigned int mkrlen();
void skipmkr(void) {
  unsigned int l;
  l = mkrlen();
  while (l) {
    jpg1byte();
    l--;
  }
}


x86 assembly (clang, -O0):
<skipmkr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <mkrlen@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1151 <skipmkr+0x31>
mov    $0x0,%al
call   1030 <jpg1byte@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <skipmkr+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipmkr>:
push   %rbx
xor    %eax,%eax
call   1040 <mkrlen@plt>
test   %eax,%eax
je     113c <skipmkr+0x1c>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <jpg1byte@plt>
add    $0xffffffff,%ebx
jne    1130 <skipmkr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skipmkr() {
%1 = alloca i32
%2 = call i32 (...) @mkrlen()
store i32 %2, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @jpg1byte()
%8 = load i32, i32* %1
%9 = add i32 %8, -1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skipmkr() {
%1 = tail call i32 (...) @mkrlen()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @jpg1byte()
%6 = add i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
void __memory_barrier(void) {
  int i;
  __asm__ __volatile("lock; incl %0" : "=m"(i) : "m"(i) : "memory");
}


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

x86 assembly (clang, -O2):
<__memory_barrier>:
lock incl -0x4(%rsp)
ret

LLVM IR (-O0):
define void @__memory_barrier() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @__memory_barrier() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *pf;
  pf = fopen("lyrics.txt", "w");
  fprintf(pf, "Ola caracola!\n");
  fclose(pf);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"lyrics.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [15 x i8] c"Ola caracola!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"lyrics.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [15 x i8] c"Ola caracola!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64 14, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
char *pstrget(char *str) {
  if (!str)
    return "";
  return str;
}


x86 assembly (clang, -O0):
<pstrget>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <pstrget+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <pstrget+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrget>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @pstrget(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8* %8, i8** %2
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @pstrget(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __lchown(const char *file, uid_t owner, gid_t group) {
  if (file == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__lchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <__lchown+0x37>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <__lchown+0x4c>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lchown>:
push   %rax
test   %rdi,%rdi
jne    111f <__lchown+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__lchown+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__lchown(i8* readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = load i32, i32* @EINVAL
%6 = load i32, i32* @ENOSYS
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @__set_errno(i32 %7)
ret i32 -1
}
void rop3_102_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D ^ S;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_102_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_102_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = and i32 %16, %19
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = or i32 %20, %26
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
define void @rop3_102_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
prefix(sub, str) register char *sub, *str;
{
  for (;;) {
    if (*sub == 0)
      return (1);
    if (*str == 0)
      return (0);
    if (*sub++ != *str++)
      return (0);
  }
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <prefix+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1181 <prefix+0x81>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1144 <prefix+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1181 <prefix+0x81>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     117c <prefix+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1181 <prefix+0x81>
jmp    110c <prefix+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%r8d
test   %r8b,%r8b
je     112c <prefix+0x2c>
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
je     112b <prefix+0x2b>
add    $0x1,%rcx
cmp    %dl,%r8b
je     1110 <prefix+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %11, %8 ]
%5 = phi i8* [ %1, %2 ], [ %12, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %3
%9 = load i8, i8* %5
%10 = icmp ne i8 %9, 0
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = icmp eq i8 %6, %9
%14 = select i1 %10, i1 %13, i1 false
br i1 %14, label %3, label %15
15: ; preds = %8, %3
%16 = phi i32 [ 1, %3 ], [ 0, %8 ]
ret i32 %16
}
void test_41_0(char *mem) { __atomic_fetch_xor(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_41_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_41_0+0x4a>
jmp    111f <test_41_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_41_0>:
lock xorb $0xff,(%rdi)
ret

LLVM IR (-O0):
define void @test_41_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 -1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_41_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
ret void
}
long is_cntrly(instr)
char *instr;
{
  for (; *instr != ((char)0L); instr++) {
    if (*instr == ((char)031))
      return (1L);
  }
  return (0L);
}


x86 assembly (clang, -O0):
<is_cntrly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <is_cntrly+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x19,%eax
jne    1135 <is_cntrly+0x35>
movq   $0x1,-0x8(%rbp)
jmp    1153 <is_cntrly+0x53>
jmp    113a <is_cntrly+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_cntrly+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cntrly>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <is_cntrly+0x11>
cmp    $0x19,%al
je     1114 <is_cntrly+0x14>
add    $0x1,%rdi
jmp    1100 <is_cntrly>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @is_cntrly(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 25, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i64 [ 1, %7 ], [ 0, %2 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ uvc_pipemsg_send(unsigned int, int /*<<< orphan*/,
                                    int /*<<< orphan*/ *);
void uvc_response_cmd(unsigned int msgId) { uvc_pipemsg_send(msgId, 0, NULL); }


x86 assembly (clang, -O0):
<uvc_response_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <uvc_pipemsg_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uvc_response_cmd>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <uvc_pipemsg_send@plt>

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

LLVM IR (-O2):
define void @uvc_response_cmd(i32 %0) {
%2 = tail call i32 @uvc_pipemsg_send(i32 %0, i32 0, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
char *inet_ntoa(struct in_addr);
char *print_ip(uint32_t ip) {
  struct in_addr a;
  a.s_addr = ip;
  return inet_ntoa(a);
}


x86 assembly (clang, -O0):
<print_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <inet_ntoa@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip>:
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @print_ip(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @inet_ntoa(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @print_ip(i32 %0) {
%2 = tail call i8* @inet_ntoa(i32 %0)
ret i8* %2
}