xunge/DecIR huggingface dataset:
int main(int argc, const char *argv[]) {
  signed char a = -1;
  unsigned char b = 2;
  short c = -3;
  unsigned short d = 4;
  int e = -5;
  unsigned f = 6;
  long g = -7;
  unsigned long h = 8;
  float i = -9.15;
  double j = 1.35;
  long double k = 4896.7;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0xff,-0x11(%rbp)
movb   $0x2,-0x12(%rbp)
movw   $0xfffd,-0x14(%rbp)
movw   $0x4,-0x16(%rbp)
movl   $0xfffffffb,-0x1c(%rbp)
movl   $0x6,-0x20(%rbp)
movq   $0xfffffffffffffff9,-0x28(%rbp)
ff
movq   $0x8,-0x30(%rbp)
movl   $0xc1126666,-0x34(%rbp)
movabs $0x3ff599999999999a,%rax
99 f5 3f
mov    %rax,-0x40(%rbp)
fldl   0xea1(%rip)
fstpt  -0x50(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca float
%15 = alloca double
%16 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -1, i8* %6
store i8 2, i8* %7
store i16 -3, i16* %8
store i16 4, i16* %9
store i32 -5, i32* %10
store i32 6, i32* %11
store i64 -7, i64* %12
store i64 8, i64* %13
store float 0xC0224CCCC0000000, float* %14
store double 1.350000e+00, double* %15
store x86_fp80 0xK400B9905999999999800, x86_fp80* %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
int flag_emergency(unsigned char *element, int element_len) {
  lprintf(1, "* * * EMERGENCY * * *\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<flag_emergency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
call   1030 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_emergency>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"* * * EMERGENCY * * *\0D\0A\00"
define i32 @flag_emergency(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @lprintf(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"* * * EMERGENCY * * *\0D\0A\00"
define i32 @flag_emergency(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @lprintf(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int devcgroup_inode_permission(struct inode *inode, int mask) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @devcgroup_inode_permission(%struct.inode* %0, i32 %1) {
%3 = alloca %struct.inode*
%4 = alloca i32
store %struct.inode* %0, %struct.inode** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @devcgroup_inode_permission(%struct.inode* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
void uninitvar_ferror(void) {
  FILE *stream;
  (void)ferror(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_ferror>:
jmp    1030 <ferror@plt>

LLVM IR (-O0):
define void @uninitvar_ferror() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @ferror(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ferror() {
%1 = tail call i32 @ferror(i32* undef)
ret void
}
/* Variables and functions */
char *decode();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  const char *status_msg = decode();
  if (status_msg) {
    fprintf(stderr, "%s\n", status_msg);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <decode@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1171 <main+0x51>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <decode@plt>
test   %rax,%rax
je     114c <main+0x2c>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%edi
lea    0xec1(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* (...) @decode()
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @decode()
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
void ConfigureBridge(void) {
  (*((volatile unsigned long *)(0x400FE104))) |= 0x00000001;
  (*((volatile unsigned long *)(0x40004000 + 0x00000420))) |= 0x3;
  (*((volatile unsigned long *)(0x40004000 + 0x0000051C))) |= 0x03;
  (*((volatile unsigned long *)(0x4000C000 + 0x00000024))) =
      ((((16000000 * 8) / 115200) + 1) / 2) >> 6;
  (*((volatile unsigned long *)(0x4000C000 + 0x00000028))) =
      (((((16000000 * 8) / 115200) + 1) / 2) & 0x0000003F);
  (*((volatile unsigned long *)(0x4000C000 + 0x0000002C))) =
      0x00000060 | 0x00000010;
  (*((volatile unsigned long *)(0x4000C000 + 0x00000030))) =
      (0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<ConfigureBridge>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe104,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400fe104,%eax
mov    %rcx,(%rax)
mov    $0x40004420,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x40004420,%eax
mov    %rcx,(%rax)
mov    $0x4000451c,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x4000451c,%eax
mov    %rcx,(%rax)
mov    $0x4000c024,%eax
movq   $0x8,(%rax)
mov    $0x4000c028,%eax
movq   $0x2c,(%rax)
mov    $0x4000c02c,%eax
movq   $0x70,(%rax)
mov    $0x4000c030,%eax
movq   $0x301,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigureBridge>:
orq    $0x1,0x400fe104
40 01
orq    $0x3,0x40004420
40 03
orq    $0x3,0x4000451c
40 03
movq   $0x8,0x4000c024
movq   $0x2c,0x4000c028
movq   $0x70,0x4000c02c
movq   $0x301,0x4000c030
ret

LLVM IR (-O0):
define void @ConfigureBridge() {
%1 = load volatile i64, i64* inttoptr (i64 1074782468 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1074782468 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073759264 to i64*)
%4 = or i64 %3, 3
store volatile i64 %4, i64* inttoptr (i64 1073759264 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1073759516 to i64*)
%6 = or i64 %5, 3
store volatile i64 %6, i64* inttoptr (i64 1073759516 to i64*)
store volatile i64 8, i64* inttoptr (i64 1073791012 to i64*)
store volatile i64 44, i64* inttoptr (i64 1073791016 to i64*)
store volatile i64 112, i64* inttoptr (i64 1073791020 to i64*)
store volatile i64 769, i64* inttoptr (i64 1073791024 to i64*)
ret void
}

LLVM IR (-O2):
define void @ConfigureBridge() {
%1 = load volatile i64, i64* inttoptr (i64 1074782468 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1074782468 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073759264 to i64*)
%4 = or i64 %3, 3
store volatile i64 %4, i64* inttoptr (i64 1073759264 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1073759516 to i64*)
%6 = or i64 %5, 3
store volatile i64 %6, i64* inttoptr (i64 1073759516 to i64*)
store volatile i64 8, i64* inttoptr (i64 1073791012 to i64*)
store volatile i64 44, i64* inttoptr (i64 1073791016 to i64*)
store volatile i64 112, i64* inttoptr (i64 1073791020 to i64*)
store volatile i64 769, i64* inttoptr (i64 1073791024 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
void set(int *a) { test_assert(*a == 8); }


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x8,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
xor    %eax,%eax
cmpl   $0x8,(%rdi)
sete   %al
mov    %eax,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @set(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @set(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 8
%4 = zext i1 %3 to i32
%5 = tail call i32 @test_assert(i32 %4)
ret void
}
int a1(void) { return 10; }


x86 assembly (clang, -O0):
<a1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @a1() {
ret i32 10
}

LLVM IR (-O2):
define i32 @a1() {
ret i32 10
}
void cop_optional_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @cop_optional_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ downhill_simplex();
int /*<<< orphan*/ read_config();
int main(int argn, char **argv) {
  int i;
  read_config();
  downhill_simplex();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @read_config()
%8 = call i32 (...) @downhill_simplex()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @read_config()
%4 = tail call i32 (...) @downhill_simplex()
ret i32 0
}
/* Variables and functions */
int SIGALRM;
int raise(int);
void test(void) {
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = raise(signal_number);
}


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

x86 assembly (clang, -O2):
<test>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @SIGALRM
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @raise(i32 %4)
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @test() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetConstructPPForm(void *, struct constructHeader *,
                                      char const *);
void EnvSetDefinstancesPPForm(void *theEnv, void *theDefinstances,
                              const char *thePPForm) {
  SetConstructPPForm(theEnv, (struct constructHeader *)theDefinstances,
                     thePPForm);
}


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

x86 assembly (clang, -O2):
<EnvSetDefinstancesPPForm>:
jmp    1030 <SetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define void @EnvSetDefinstancesPPForm(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.constructHeader*
%10 = load i8*, i8** %6
%11 = call i32 @SetConstructPPForm(i8* %7, %struct.constructHeader* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define void @EnvSetDefinstancesPPForm(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to %struct.constructHeader*
%5 = tail call i32 @SetConstructPPForm(i8* %0, %struct.constructHeader* %4, i8* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
unsigned long get_XNoExposeEvent_serial(void *_p) {
  return (unsigned long)((XNoExposeEvent *)_p)->serial;
}


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

x86 assembly (clang, -O2):
<get_XNoExposeEvent_serial>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XNoExposeEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XNoExposeEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char *, int, int);
int printf(char *, void *);
int strlen(char *);
void DoPointerTest(char *formatstr, void *param, char *paramstr,
                   char *checkstr1) {
  int ret;
  ret = printf(formatstr, param);
  if (ret != strlen(checkstr1)) {
    Fail("Expected printf to return %d, got %d.\n", strlen(checkstr1), ret);
  }
}


x86 assembly (clang, -O0):
<DoPointerTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <printf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
je     118e <DoPointerTest+0x5e>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x24(%rbp),%edx
lea    0xe77(%rip),%rdi
call   1050 <Fail@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoPointerTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
call   1040 <printf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoPointerTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoPointerTest(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* %10, i8* %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i8*, i8** %8
%15 = call i32 @strlen(i8* %14)
%16 = icmp ne i32 %13, %15
br i1 %16, label %17, label %22
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = call i32 @strlen(i8* %18)
%20 = load i32, i32* %9
%21 = call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
br label %22
22: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoPointerTest(i8* %0, i8* %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* %0, i8* %1)
%6 = tail call i32 @strlen(i8* %3)
%7 = icmp eq i32 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @strlen(i8* %3)
%10 = tail call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %5)
br label %11
11: ; preds = %8, %4
ret void
}
void interrupt_hard_fault(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<interrupt_hard_fault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <interrupt_hard_fault+0x9>
jmp    1109 <interrupt_hard_fault+0x9>

x86 assembly (clang, -O2):
<interrupt_hard_fault>:
jmp    1100 <interrupt_hard_fault>

LLVM IR (-O0):
define void @interrupt_hard_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @interrupt_hard_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_LDHU_SP_A0(int r) { C67_asm("LDHU.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_LDHU_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDHU_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"LDHU.D *+SP[A0]\00"
define void @C67_LDHU_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"LDHU.D *+SP[A0]\00"
define void @C67_LDHU_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
double mercatorX(double);
double geohashGetXMercator(double lng) {
  if (lng > 180 || lng < -180) {
    return lng;
  }
  return mercatorX(lng);
}


x86 assembly (clang, -O0):
<geohashGetXMercator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1147 <geohashGetXMercator+0x37>
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1156 <geohashGetXMercator+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <geohashGetXMercator+0x55>
movsd  -0x10(%rbp),%xmm0
call   1030 <mercatorX@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geohashGetXMercator>:
ucomisd 0xee8(%rip),%xmm0
ja     112d <geohashGetXMercator+0x1d>
movsd  0xee6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     112d <geohashGetXMercator+0x1d>
jmp    1030 <mercatorX@plt>
ret

LLVM IR (-O0):
define double @geohashGetXMercator(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.800000e+02
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp olt double %7, -1.800000e+02
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load double, double* %3
store double %10, double* %2
br label %14
11: ; preds = %6
%12 = load double, double* %3
%13 = call double @mercatorX(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %9
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @geohashGetXMercator(double %0) {
%2 = fcmp ogt double %0, 1.800000e+02
%3 = fcmp olt double %0, -1.800000e+02
%4 = or i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call double @mercatorX(double %0)
br label %7
7: ; preds = %1, %5
%8 = phi double [ %6, %5 ], [ %0, %1 ]
ret double %8
}
void ILibWrapper_WebRTC_OnOfferUpdated(void *stunModule, char *iceOffer,
                                       int iceOfferLen) {}


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

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

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

LLVM IR (-O2):
define void @ILibWrapper_WebRTC_OnOfferUpdated(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void signal_handler(int signo) {
  if (signo == SIGINT) {
    system("sudo killall fbi");
    printf("\x1B[33m"
           "Exit program\nThank you\n"
           "\033[0m");
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1173 <signal_handler+0x43>
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <signal_handler+0xe>
pop    %rax
ret
lea    0xebb(%rip),%rdi
call   1030 <system@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [17 x i8] c"sudo killall fbi\00"
@.str.1 = [33 x i8] c"\1B[33mExit program\0AThank you\0A\1B[0m\00"
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [17 x i8] c"sudo killall fbi\00"
@.str.1 = [33 x i8] c"\1B[33mExit program\0AThank you\0A\1B[0m\00"
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main() {

#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

  f();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double el_ecc(double semiMajor, double semiMinor) {
  return sqrt(1.0 - (semiMinor / semiMajor) * (semiMinor / semiMajor));
}


x86 assembly (clang, -O0):
<el_ecc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_ecc>:
divsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
movsd  0xee0(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <el_ecc+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @el_ecc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double %5, %6
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fdiv double %8, %9
%11 = fneg double %7
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
%13 = call double @sqrt(double %12)
ret double %13
}

LLVM IR (-O2):
define double @el_ecc(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void dbg_vPrintfImpl(const char *Private_pcSrcFileName,
                                              uint32_t Private_u32SrcLineNumber,
                                              const char *pcFormat, ...) {}


x86 assembly (clang, -O0):
<dbg_vPrintfImpl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dbg_vPrintfImpl(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
unsigned char galois_mult_by_two(unsigned char);
unsigned char galois_mult_by_eleven(unsigned char val) {
  return galois_mult_by_two(galois_mult_by_two(galois_mult_by_two(val)) ^ val) ^
         val;
}


x86 assembly (clang, -O0):
<galois_mult_by_eleven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois_mult_by_eleven>:
push   %rbx
mov    %edi,%ebx
call   1030 <galois_mult_by_two@plt>
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
xor    %bl,%al
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
xor    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @galois_mult_by_eleven(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @galois_mult_by_two(i8 zeroext %3)
%5 = call zeroext i8 @galois_mult_by_two(i8 zeroext %4)
%6 = zext i8 %5 to i32
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
%11 = call zeroext i8 @galois_mult_by_two(i8 zeroext %10)
%12 = zext i8 %11 to i32
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @galois_mult_by_eleven(i8 zeroext %0) {
%2 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %0)
%3 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %2)
%4 = xor i8 %3, %0
%5 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %4)
%6 = xor i8 %5, %0
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
bool I2CMasterBusBusy(uint32_t ui32Base) {
  ;
  if ((*((volatile unsigned long *)(0x40002000 + 0x00000804))) & 0x00000040) {
    return (true);
  } else {
    return (false);
  }
}


x86 assembly (clang, -O0):
<I2CMasterBusBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x40002804,%eax
mov    (%rax),%rax
and    $0x40,%rax
cmp    $0x0,%rax
je     1129 <I2CMasterBusBusy+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <I2CMasterBusBusy+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterBusBusy>:
mov    0x40002804,%rax
40
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterBusBusy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%5 = and i64 %4, 64
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @I2CMasterBusBusy(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}
int QuxMultiple(int a, char b) {
  return 51;
  return 52;
  return 53;
}


x86 assembly (clang, -O0):
<QuxMultiple>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x33,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @QuxMultiple(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
ret i32 51
}

LLVM IR (-O2):
define i32 @QuxMultiple(i32 %0, i8 signext %1) {
ret i32 51
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void missarg(const char *key) {
  fprintf(stderr, "Error: argument \"%s\" is required\n", key);
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Error: argument \22%s\22 is required\0A\00"
define void @missarg(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 ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Error: argument \22%s\22 is required\0A\00"
define void @missarg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_cyan() { return fputs("[36m", stdout); }


x86 assembly (clang, -O0):
<f_cyan>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_cyan>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[36m\00"
@stdout = global i32 0
define i32 @f_cyan() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[36m\00"
@stdout = global i32 0
define i32 @f_cyan() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void foo(void) {
#pragma acc parallel
  ;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t random32(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @random32() {
ret i32 1
}

LLVM IR (-O2):
define i32 @random32() {
ret i32 1
}
char f(int x) { return x + 12345; }


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

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

LLVM IR (-O0):
define signext i8 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12345
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @f(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 57
ret i8 %3
}
int execve(const char *filename, char *const argv[], char *const envp[]) {
  ;
  typeof(execve) *orig_execve = osym("execve");
  interpose_fini();
  int rc = (*orig_execve)(filename, argv, envp);
  interpose_init();
  return rc;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <osym@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <interpose_fini@plt>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   *%rax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <interpose_init@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1050 <osym@plt>
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <interpose_fini@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   *%rbx
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <interpose_init@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"execve\00"
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32 (i8*, i8**, i8**)*
%8 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32 (i8*, i8**, i8**)*
store i32 (i8*, i8**, i8**)* %11, i32 (i8*, i8**, i8**)** %7
%12 = call i32 (...) @interpose_fini()
%13 = load i32 (i8*, i8**, i8**)*, i32 (i8*, i8**, i8**)** %7
%14 = load i8*, i8** %4
%15 = load i8**, i8*** %5
%16 = load i8**, i8*** %6
%17 = call i32 %13(i8* %14, i8** %15, i8** %16)
store i32 %17, i32* %8
%18 = call i32 (...) @interpose_init()
%19 = load i32, i32* %8
ret i32 %19
}

LLVM IR (-O2):
@.str = [7 x i8] c"execve\00"
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32 (i8*, i8**, i8**)*
%7 = tail call i32 (...) @interpose_fini()
%8 = tail call i32 %6(i8* %0, i8** %1, i8** %2)
%9 = tail call i32 (...) @interpose_init()
ret i32 %8
}
int kstrlen(const char *s) {
  const char *p = s;
  while (*p != '\0')
    p++;
  return (int)(p - s);
}


x86 assembly (clang, -O0):
<kstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <kstrlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <kstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hallo, mein Freund\n Mein Name ist Mario\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Hallo, mein Freund\0A Mein Name ist Mario\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [40 x i8] c"Hallo, mein Freund\0A Mein Name ist Mario\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int contains(unsigned int *arr, unsigned int val, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (arr[i] == val)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1154 <contains+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1141 <contains+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <contains+0x5b>
jmp    1146 <contains+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <contains+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %edx,%edx
jle    111e <contains+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %esi,(%rdi,%rcx,4)
je     1121 <contains+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %1
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ VFAIL(char *, char *, int);
void setUpFails() {
  {
    if (!(0)) {
      VFAIL("0",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/MoserMichael/cstuff/refs/heads/master/"
            "vtest/example.c",
            18);
      return;
    }
  }
  while (0)
    ;
  ;
}


x86 assembly (clang, -O0):
<setUpFails>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x12,%edx
call   1030 <VFAIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setUpFails>:
lea    0xee9(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x12,%edx
jmp    1030 <VFAIL@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MoserMichael/cstuff/refs/heads/master/vtest/example.c\00"
define void @setUpFails() {
%1 = call i32 @VFAIL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MoserMichael/cstuff/refs/heads/master/vtest/example.c\00"
define void @setUpFails() {
%1 = tail call i32 @VFAIL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FP();
int /*<<< orphan*/ G();
int /*<<< orphan*/ printf(char *);
void F() {
  printf("F -> GF'\n");
  G();
  FP();
}


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <G@plt>
mov    $0x0,%al
call   1030 <FP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <G@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <FP@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"F -> GF'\0A\00"
define void @F() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @G()
%3 = call i32 (...) @FP()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"F -> GF'\00"
define void @F() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @G()
%3 = tail call i32 (...) @FP()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void srm(int flag) {
  if (flag)
    sm("12");
  else
    rm("12");
}


x86 assembly (clang, -O0):
<srm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <srm+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <srm+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srm>:
test   %edi,%edi
je     1130 <srm+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"12\00"
define void @srm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"12\00"
define void @srm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void dacoff() {
  *((volatile uint32_t *)(0x40004000 + 0x008)) = 0;
  *((volatile uint32_t *)(0x40004000 + 0x00c)) = 0;
  *((volatile uint32_t *)(0x400c8000 + 0x044)) &= ~(1 << 17);
}


x86 assembly (clang, -O0):
<dacoff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40004008,%eax
movl   $0x0,(%rax)
mov    $0x4000400c,%eax
movl   $0x0,(%rax)
mov    $0x400c8044,%eax
mov    (%rax),%ecx
and    $0xfffdffff,%ecx
mov    $0x400c8044,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dacoff>:
movl   $0x0,0x40004008
movl   $0x0,0x4000400c
andl   $0xfffdffff,0x400c8044
ff ff fd ff
ret

LLVM IR (-O0):
define void @dacoff() {
store volatile i32 0, i32* inttoptr (i64 1073758216 to i32*)
store volatile i32 0, i32* inttoptr (i64 1073758220 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1074561092 to i32*)
%2 = and i32 %1, -131073
store volatile i32 %2, i32* inttoptr (i64 1074561092 to i32*)
ret void
}

LLVM IR (-O2):
define void @dacoff() {
store volatile i32 0, i32* inttoptr (i64 1073758216 to i32*)
store volatile i32 0, i32* inttoptr (i64 1073758220 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1074561092 to i32*)
%2 = and i32 %1, -131073
store volatile i32 %2, i32* inttoptr (i64 1074561092 to i32*)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int mystrcmp(void *v1, void *v2) { return (strcmp((char *)v1, (char *)v2)); }


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

x86 assembly (clang, -O2):
<mystrcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}