xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x72() {
  Assert_real((isxdigit(114) == 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_isxdigit.c",
              575, ("isxdigit should be 0 for r"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x23f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for r\00"
define void @t_isxdigit_0x72() {
%1 = call i64 @isxdigit(i32 114)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for r\00"
define void @t_isxdigit_0x72() {
%1 = tail call i64 @isxdigit(i32 114)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenLRSHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void OpenLRSRequestUpdate() { UAVObjRequestUpdate(OpenLRSHandle()); }


x86 assembly (clang, -O0):
<OpenLRSRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OpenLRSHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenLRSRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <OpenLRSHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @OpenLRSRequestUpdate() {
%1 = call i32 (...) @OpenLRSHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpenLRSRequestUpdate() {
%1 = tail call i32 (...) @OpenLRSHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc3() {
  Assert_real((isalpha(195) == 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",
              980, ("isalpha should be 0 for 0xc3"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%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 0xc3\00"
define void @t_isalpha_0xc3() {
%1 = call i64 @isalpha(i32 195)
%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 980, 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 0xc3\00"
define void @t_isalpha_0xc3() {
%1 = tail call i64 @isalpha(i32 195)
%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 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_20_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_20_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_20_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_20_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_20_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ simplehttp_free();
int /*<<< orphan*/ simplehttp_listen();
int /*<<< orphan*/ simplehttp_run();
int simplehttp_main() {
  if (!simplehttp_listen()) {
    return 1;
  }
  simplehttp_run();
  simplehttp_free();
  return 0;
}


x86 assembly (clang, -O0):
<simplehttp_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <simplehttp_listen@plt>
cmp    $0x0,%eax
jne    1154 <simplehttp_main+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1169 <simplehttp_main+0x39>
mov    $0x0,%al
call   1040 <simplehttp_run@plt>
mov    $0x0,%al
call   1050 <simplehttp_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplehttp_main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <simplehttp_listen@plt>
test   %eax,%eax
je     114e <simplehttp_main+0x1e>
xor    %eax,%eax
call   1040 <simplehttp_run@plt>
xor    %eax,%eax
call   1050 <simplehttp_free@plt>
jmp    1153 <simplehttp_main+0x23>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @simplehttp_main() {
%1 = alloca i32
%2 = call i32 (...) @simplehttp_listen()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 (...) @simplehttp_run()
%7 = call i32 (...) @simplehttp_free()
store i32 0, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @simplehttp_main() {
%1 = tail call i32 (...) @simplehttp_listen()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @simplehttp_run()
%5 = tail call i32 (...) @simplehttp_free()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int protected_mode_call_2arg(void *func, uint32_t arg1, uint32_t arg2) {
  int (*doit)(uint32_t arg1, uint32_t arg2) = func;
  return doit(arg1, arg2);
}


x86 assembly (clang, -O0):
<protected_mode_call_2arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protected_mode_call_2arg>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @protected_mode_call_2arg(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32 (i32, i32)*
%5 = tail call i32 %4(i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int strlen(char const *);
int endsWithSuffix(const char *s, const char *suffix) {
  int sLength = strlen(s);
  int suffixLength = strlen(suffix);
  return (sLength >= suffixLength) &&
         (strcmp(s + (sLength - suffixLength), suffix) == 0);
}


x86 assembly (clang, -O0):
<endsWithSuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
jl     117b <endsWithSuffix+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endsWithSuffix>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%ebp
jl     115d <endsWithSuffix+0x3d>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @endsWithSuffix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
int xisupper(int c) { return (c >= (int)'A' && c <= (int)'Z'); }


x86 assembly (clang, -O0):
<xisupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xisupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xisupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xisupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsncat(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninitvar_wcsncat(wchar_t *Ct, wchar_t *S, size_t N) {
  wchar_t *ct;
  wchar_t *s;
  size_t n;
  (void)wcsncat(ct, s, n);
  (void)wcsncat(ct, S, N);
  (void)wcsncat(Ct, s, N);
  (void)wcsncat(Ct, S, n);
  (void)wcsncat(Ct, S, N);
}


x86 assembly (clang, -O0):
<uninitvar_wcsncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <wcsncat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <wcsncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsncat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcsncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <wcsncat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <wcsncat@plt>

LLVM IR (-O0):
define void @uninitvar_wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%10 = load i32*, i32** %7
%11 = load i32*, i32** %8
%12 = load i64, i64* %9
%13 = call i32 @wcsncat(i32* %10, i32* %11, i64 %12)
%14 = load i32*, i32** %7
%15 = load i32*, i32** %5
%16 = load i64, i64* %6
%17 = call i32 @wcsncat(i32* %14, i32* %15, i64 %16)
%18 = load i32*, i32** %4
%19 = load i32*, i32** %8
%20 = load i64, i64* %6
%21 = call i32 @wcsncat(i32* %18, i32* %19, i64 %20)
%22 = load i32*, i32** %4
%23 = load i32*, i32** %5
%24 = load i64, i64* %9
%25 = call i32 @wcsncat(i32* %22, i32* %23, i64 %24)
%26 = load i32*, i32** %4
%27 = load i32*, i32** %5
%28 = load i64, i64* %6
%29 = call i32 @wcsncat(i32* %26, i32* %27, i64 %28)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @wcsncat(i32* undef, i32* undef, i64 undef)
%5 = tail call i32 @wcsncat(i32* undef, i32* %1, i64 %2)
%6 = tail call i32 @wcsncat(i32* %0, i32* undef, i64 %2)
%7 = tail call i32 @wcsncat(i32* %0, i32* %1, i64 undef)
%8 = tail call i32 @wcsncat(i32* %0, i32* %1, i64 %2)
ret void
}
unsigned long DCSMZone2ECSLSecurityStatus(void) {
  unsigned long status;
  status = (*((volatile unsigned long *)(0x400FB400 + 0x00000084)));
  if ((status & 0x1000) && ((status & 0x0400) || (status & 0x0100))) {
    return (0);
  } else {
    return (1);
  }
}


x86 assembly (clang, -O0):
<DCSMZone2ECSLSecurityStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb484,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1000,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone2ECSLSecurityStatus+0x59>
mov    -0x10(%rbp),%rax
and    $0x400,%rax
cmp    $0x0,%rax
jne    114c <DCSMZone2ECSLSecurityStatus+0x4c>
mov    -0x10(%rbp),%rax
and    $0x100,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone2ECSLSecurityStatus+0x59>
movq   $0x0,-0x8(%rbp)
jmp    1161 <DCSMZone2ECSLSecurityStatus+0x61>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMZone2ECSLSecurityStatus>:
mov    0x400fb484,%rax
40
test   $0x1000,%eax
sete   %cl
test   $0x500,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i64 @DCSMZone2ECSLSecurityStatus() {
%1 = alloca i64
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 1074771076 to i64*)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 4096
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = load i64, i64* %2
%9 = and i64 %8, 1024
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i64, i64* %2
%13 = and i64 %12, 256
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i64 0, i64* %1
br label %17
16: ; preds = %11, %0
store i64 1, i64* %1
br label %17
17: ; preds = %16, %15
%18 = load i64, i64* %1
ret i64 %18
}

LLVM IR (-O2):
define i64 @DCSMZone2ECSLSecurityStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074771076 to i64*)
%2 = and i64 %1, 4096
%3 = icmp eq i64 %2, 0
%4 = and i64 %1, 1280
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
%7 = zext i1 %6 to i64
ret i64 %7
}
__attribute__((always_)) void mm_init_owner(struct mm_struct *mm,
                                            struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
%struct.task_struct = type opaque
define void @mm_init_owner(%struct.mm_struct* %0, %struct.task_struct* %1) {
%3 = alloca %struct.mm_struct*
%4 = alloca %struct.task_struct*
store %struct.mm_struct* %0, %struct.mm_struct** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
%struct.task_struct = type opaque
define void @mm_init_owner(%struct.mm_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
scalar_t__ EPERM;
scalar_t__ errno;
int setgroups(int, scalar_t__ *);
int main(void) {
  gid_t gidset[1];
  gidset[0] = 0;
  if (setgroups(1, gidset) == -1 && errno != EPERM)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    1164 <main+0x54>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <main+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
mov    $0x1,%ebx
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
call   1030 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    114d <main+0x3d>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    114f <main+0x3f>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EPERM = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i64]
store i32 0, i32* %1
%3 = getelementptr inbounds [1 x i64], [1 x i64]* %2, i64 0, i64 0
store i64 0, i64* %3
%4 = getelementptr inbounds [1 x i64], [1 x i64]* %2, i64 0, i64 0
%5 = call i32 @setgroups(i32 1, i64* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i64, i64* @errno
%9 = load i64, i64* @EPERM
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %1
br label %13
12: ; preds = %7, %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@errno = global i64 0
@EPERM = global i64 0
define i32 @main() {
%1 = alloca [1 x i64]
%2 = bitcast [1 x i64]* %1 to i8*
%3 = getelementptr inbounds [1 x i64], [1 x i64]* %1, i64 0, i64 0
store i64 0, i64* %3
%4 = call i32 @setgroups(i32 1, i64* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EPERM
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %0
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %12
}
/* Variables and functions */
int rand();
int generate_rand_number_(int from, int to) {
  int num;
  num = rand() % (to - from) + from;
  return num;
}


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

x86 assembly (clang, -O2):
<generate_rand_number_>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @generate_rand_number_(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %6, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @generate_rand_number_(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int decode_hex(int ch) {
  if ('0' <= ch && ch <= '9')
    return ch - '0';
  if ('A' <= ch && ch <= 'F')
    return ch - 'A' + 0xa;
  if ('a' <= ch && ch <= 'f')
    return ch - 'a' + 0xa;
  return -1;
}


x86 assembly (clang, -O0):
<decode_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     112d <decode_hex+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <decode_hex+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <decode_hex+0x86>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1156 <decode_hex+0x56>
cmpl   $0x46,-0x8(%rbp)
jg     1156 <decode_hex+0x56>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <decode_hex+0x86>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     117f <decode_hex+0x7f>
cmpl   $0x66,-0x8(%rbp)
jg     117f <decode_hex+0x7f>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <decode_hex+0x86>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <decode_hex+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <decode_hex+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @decode_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ldl_le_p(const void *ptr) {
  const uint8_t *p = ptr;
  return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}


x86 assembly (clang, -O0):
<ldl_le_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldl_le_p>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ldl_le_p(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 16
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 24
%23 = or i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @ldl_le_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fat32_wr16(int /*<<< orphan*/ *, int);
void fat32_write_sig(void *b, unsigned sector_size) {
  fat32_wr16((uint8_t *)b + 512 - 2, 0xaa55);
  fat32_wr16((uint8_t *)b + sector_size - 2, 0xaa55);
}


x86 assembly (clang, -O0):
<fat32_write_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x800,%rdi
add    $0xfffffffffffffff8,%rdi
mov    $0xaa55,%esi
call   1030 <fat32_wr16@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
mov    $0xaa55,%esi
call   1030 <fat32_wr16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat32_write_sig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x7f8,%rdi
mov    $0xaa55,%esi
call   1030 <fat32_wr16@plt>
mov    %ebp,%eax
lea    (%rbx,%rax,4),%rdi
add    $0xfffffffffffffff8,%rdi
mov    $0xaa55,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fat32_wr16@plt>

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

LLVM IR (-O2):
define void @fat32_write_sig(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 2040
%5 = bitcast i8* %4 to i32*
%6 = tail call i32 @fat32_wr16(i32* %5, i32 43605)
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %3, i64 %7
%9 = getelementptr inbounds i32, i32* %8, i64 -2
%10 = tail call i32 @fat32_wr16(i32* %9, i32 43605)
ret void
}
__attribute__((__format__(__printf__, 1, 2))) void
Gcc_checkPrintf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @Gcc_checkPrintf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void vulnerable(const char *attack) {
  char buf[100];
  strcpy(buf, attack);
}


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

x86 assembly (clang, -O2):
<vulnerable>:
sub    $0x68,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define void @vulnerable(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @vulnerable(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x11() {
  Assert_real((ispunct(17) == 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_ispunct.c",
              90, ("ispunct should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x11\00"
define void @t_ispunct_0x11() {
%1 = call i64 @ispunct(i32 17)
%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 90, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x11\00"
define void @t_ispunct_0x11() {
%1 = tail call i64 @ispunct(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ErrorMessage(char *, size_t);
void *malloc(size_t);
void *MallocWithErrorMessage(size_t Size) {
  void *Ptr;
  if (!(Ptr = malloc(Size)))
    ErrorMessage("Memory allocation of %u bytes failed.\n", Size);
  return Ptr;
}


x86 assembly (clang, -O0):
<MallocWithErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <MallocWithErrorMessage+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <ErrorMessage@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MallocWithErrorMessage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <MallocWithErrorMessage+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <ErrorMessage@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Memory allocation of %u bytes failed.\0A\00"
define i8* @MallocWithErrorMessage(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @ErrorMessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [39 x i8] c"Memory allocation of %u bytes failed.\0A\00"
define noalias i8* @MallocWithErrorMessage(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ErrorMessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int setegid(int euid) {}


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

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

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

LLVM IR (-O2):
define i32 @setegid(i32 %0) {
ret i32 undef
}
unsigned long long brute_force(unsigned long long max) {
  unsigned long long i;
  unsigned long long sum = 0;
  for (i = 1; i < max; i++) {
    if (i % 3 == 0 || i % 5 == 0) {
      sum += i;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<brute_force>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1178 <brute_force+0x78>
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     1156 <brute_force+0x56>
mov    -0x10(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1162 <brute_force+0x62>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <brute_force+0x67>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <brute_force+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brute_force>:
cmp    $0x2,%rdi
jb     116d <brute_force+0x6d>
mov    $0x1,%esi
xor    %r8d,%r8d
movabs $0xaaaaaaaaaaaaaaab,%r9
aa aa aa
movabs $0xcccccccccccccccd,%r10
cc cc cc
jmp    1147 <brute_force+0x47>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rcx,%rcx,2),%rcx
cmp    %rcx,%rsi
cmove  %rsi,%rax
add    %rax,%r8
add    $0x1,%rsi
cmp    %rsi,%rdi
je     1170 <brute_force+0x70>
mov    %rsi,%rax
mul    %r9
mov    %rdx,%rcx
mov    %rsi,%rax
mul    %r10
shr    %rcx
shr    $0x2,%rdx
lea    (%rdx,%rdx,4),%rdx
mov    %rsi,%rax
cmp    %rdx,%rsi
je     1130 <brute_force+0x30>
xor    %eax,%eax
jmp    1130 <brute_force+0x30>
xor    %r8d,%r8d
mov    %r8,%rax
ret

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

LLVM IR (-O2):
define i64 @brute_force(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %15
3: ; preds = %1, %3
%4 = phi i64 [ %12, %3 ], [ 0, %1 ]
%5 = phi i64 [ %13, %3 ], [ 1, %1 ]
%6 = urem i64 %5, 3
%7 = icmp eq i64 %6, 0
%8 = urem i64 %5, 5
%9 = icmp eq i64 %8, 0
%10 = or i1 %7, %9
%11 = select i1 %10, i64 %5, i64 0
%12 = add i64 %11, %4
%13 = add nuw i64 %5, 1
%14 = icmp eq i64 %13, %0
br i1 %14, label %15, label %3
15: ; preds = %3, %1
%16 = phi i64 [ 0, %1 ], [ %12, %3 ]
ret i64 %16
}
double floor(double x) {
  long i = x;
  return ((double)i);
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
int dummy_is_fpga_configured(struct bladerf *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bladerf = type opaque
define i32 @dummy_is_fpga_configured(%struct.bladerf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buttons_init();
void ButtonHardware_Init(void) { buttons_init(); }


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

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

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

LLVM IR (-O2):
define void @ButtonHardware_Init() {
%1 = tail call i32 (...) @buttons_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int array[6] = {3, 7, 12, 2, 6, 10};
  int sum = 0;
  for (int i = 0; i < 6; i++) {
    sum = sum + array[i];
  }
  printf("Sum: %i\n", sum);
}


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,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x6,-0x28(%rbp)
jge    1174 <main+0x64>
mov    -0x24(%rbp),%eax
movslq -0x28(%rbp),%rcx
add    -0x20(%rbp,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114e <main+0x3e>
mov    -0x24(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [6 x i32] [i32 3, i32 7, i32 12, i32 2, i32 6, i32 10]
@.str = [9 x i8] c"Sum: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %10, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [9 x i8] c"Sum: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 40)
ret i32 0
}
unsigned getNumericGrade(char textualGrade) {
  unsigned grade;
  switch (textualGrade) {
  case 'A':
    grade = 1;
    break;
  case 'B':
    grade = 2;
    break;
  case 'C':
    grade = 3;
    break;
  case 'D':
    grade = 4;
    break;
  case 'E':
    grade = 5;
    break;
  case 'F':
    grade = 6;
    break;
  default:
    grade = 0;
  }
  return grade;
}


x86 assembly (clang, -O0):
<getNumericGrade>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     117c <getNumericGrade+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x2,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x3,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x4,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x5,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x6,-0x8(%rbp)
jmp    1183 <getNumericGrade+0x83>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumericGrade>:
lea    -0x41(%rdi),%ecx
lea    -0x40(%rdi),%edx
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @getNumericGrade(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 65, label %6
i32 66, label %7
i32 67, label %8
i32 68, label %9
i32 69, label %10
i32 70, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %13
7: ; preds = %1
store i32 2, i32* %3
br label %13
8: ; preds = %1
store i32 3, i32* %3
br label %13
9: ; preds = %1
store i32 4, i32* %3
br label %13
10: ; preds = %1
store i32 5, i32* %3
br label %13
11: ; preds = %1
store i32 6, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @getNumericGrade(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = add nsw i32 %2, -64
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int a = power(2, 3);
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <power@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <power@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @power(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int is_upper(char ch) {
  if (ch >= 'A' && ch <= 'Z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <is_upper+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <is_upper+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_upper+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_upper(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_upper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}