xunge/DecIR huggingface dataset:
int right_child(int n, int i) { return i + n + 1; }


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

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @right_child(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_SIF_SetI2cDevAddr(unsigned char adr) {
  adr >>= 1;
  adr |= 0x80;
  VIM_HIF_SetReg8((0x0800 + 0x035), adr);
}


x86 assembly (clang, -O0):
<VIM_SIF_SetI2cDevAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
mov    $0x835,%edi
movzbl -0x1(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_SIF_SetI2cDevAddr>:
shr    %dil
or     $0x80,%dil
movzbl %dil,%esi
mov    $0x835,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_SIF_SetI2cDevAddr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = or i32 %8, 128
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
%11 = load i8, i8* %2
%12 = call i32 @VIM_HIF_SetReg8(i32 2101, i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @VIM_SIF_SetI2cDevAddr(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = or i8 %2, -128
%4 = tail call i32 @VIM_HIF_SetReg8(i32 2101, i8 zeroext %3)
ret void
}
/* Variables and functions */
scalar_t__ libsais_create_ctx_main(int);
void *libsais_create_ctx(void) { return (void *)libsais_create_ctx_main(1); }


x86 assembly (clang, -O0):
<libsais_create_ctx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <libsais_create_ctx_main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<libsais_create_ctx>:
mov    $0x1,%edi
jmp    1030 <libsais_create_ctx_main@plt>

LLVM IR (-O0):
define i8* @libsais_create_ctx() {
%1 = call i64 @libsais_create_ctx_main(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @libsais_create_ctx() {
%1 = tail call i64 @libsais_create_ctx_main(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void function(void) { sleep(1); }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    $0x1,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @function() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @function() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
struct cptp {
  int dummy;
};

/* Variables and functions */
void cptp_find_header(struct cptp *p, unsigned char *b, size_t s) {}


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

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

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

LLVM IR (-O2):
%struct.cptp = type { i32 }
define void @cptp_find_header(%struct.cptp* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
uint32_t le32_to_cpu(uint32_t le_val) { return bswap_32(le_val); }


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

x86 assembly (clang, -O2):
<le32_to_cpu>:
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @le32_to_cpu(i32 %0) {
%2 = tail call i32 @bswap_32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x18() {
  Assert_real((iscntrl(24)),
              "/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_iscntrl.c",
              125, ("iscntrl should be 1 for 0x18"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x18>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x7d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x18>:
push   %rax
mov    $0x18,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x7d,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x18\00"
define void @t_iscntrl_0x18() {
%1 = call i32 @iscntrl(i32 24)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x18\00"
define void @t_iscntrl_0x18() {
%1 = tail call i32 @iscntrl(i32 24)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void ChiudiSocket(int sock) {
  close(sock);
  return;
}


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

x86 assembly (clang, -O2):
<ChiudiSocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @ChiudiSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int test_imm_4Bint16_reg(short val) {
  return ((val) & (-0x4B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Bint16_reg>:
test   $0xffb5,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -75
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ mgetline(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char s1[1000], s2[1000];
  int val;
  mgetline(s1, 1000);
  mgetline(s2, 1000);
  val = any(s1, s2);
  printf("%d", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <mgetline@plt>
lea    -0x7e0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <mgetline@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1050 <any@plt>
mov    %eax,-0x7e4(%rbp)
mov    -0x7e4(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d8,%rsp
lea    0x3f0(%rsp),%r14
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1040 <mgetline@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <mgetline@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <any@plt>
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @mgetline(i8* %3, i32 1000)
%6 = call i32 @mgetline(i8* %4, i32 1000)
%7 = call i32 @any(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int hogehoge(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hogehoge() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OptionalSyntaxCannotContainOnlyMarks(long p_position) {
  _Error(p_position, "Optional syntax cannot just contain marks");
}


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

x86 assembly (clang, -O2):
<Error_OptionalSyntaxCannotContainOnlyMarks>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Optional syntax cannot just contain marks\00"
define void @Error_OptionalSyntaxCannotContainOnlyMarks(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Optional syntax cannot just contain marks\00"
define void @Error_OptionalSyntaxCannotContainOnlyMarks(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double d1mach_(int *);
double d1mach(int *i) { return d1mach_(i); }


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

x86 assembly (clang, -O2):
<d1mach>:
jmp    1030 <d1mach_@plt>

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

LLVM IR (-O2):
define double @d1mach(i32* %0) {
%2 = tail call double @d1mach_(i32* %0)
ret double %2
}
/* Variables and functions */
scalar_t__ ExUtilGetUInt(char const *const, int, int *const);
int ExUtilGetInt(const char *const v, int base, int *const error) {
  return (int)ExUtilGetUInt(v, base, error);
}


x86 assembly (clang, -O0):
<ExUtilGetInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <ExUtilGetUInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExUtilGetInt>:
jmp    1030 <ExUtilGetUInt@plt>

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

LLVM IR (-O2):
define i32 @ExUtilGetInt(i8* %0, i32 %1, i32* %2) {
%4 = tail call i64 @ExUtilGetUInt(i8* %0, i32 %1, i32* %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int);
int /*<<< orphan*/ stderr;
void check_ints(int actual, int expected, const char *msg) {
  if (expected == actual) {
    return;
  }
  fprintf(stderr, "FAIL: %s Expected %d but was %d\n", msg, expected, actual);
  exit(1);
}


x86 assembly (clang, -O0):
<check_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1144 <check_ints+0x24>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check_ints>:
cmp    %edi,%esi
jne    1125 <check_ints+0x5>
ret
push   %rax
mov    %esi,%ecx
mov    %edi,%r8d
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"FAIL: %s Expected %d but was %d\0A\00"
define void @check_ints(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
ret void
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"FAIL: %s Expected %d but was %d\0A\00"
define void @check_ints(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, %0
br i1 %4, label %5, label %6
5: ; preds = %3
ret void
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1, i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-itw] file ...\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [-itw] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int cad_copiar(char s1[], char s2[]) {
  while ((*s2++ = *s1++))
    ;
  return 1;
}


x86 assembly (clang, -O0):
<cad_copiar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <cad_copiar+0x3b>
jmp    110c <cad_copiar+0xc>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cad_copiar>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <cad_copiar+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cad_copiar(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 1
}
/* Variables and functions */
scalar_t__ data_getresource(int, int);
int data_totresources(int p) {
  int sum = 0;
  int i;
  for (i = 0; i < 5; i++)
    sum += data_getresource(p, i);
  return sum;
}


x86 assembly (clang, -O0):
<data_totresources>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1159 <data_totresources+0x49>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <data_getresource@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <data_totresources+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_totresources>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
xor    %esi,%esi
call   1030 <data_getresource@plt>
mov    %rax,%r14
mov    %r15d,%edi
mov    $0x1,%esi
call   1030 <data_getresource@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    %r15d,%edi
mov    $0x2,%esi
call   1030 <data_getresource@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    %r15d,%edi
mov    $0x3,%esi
call   1030 <data_getresource@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r15d,%edi
mov    $0x4,%esi
call   1030 <data_getresource@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @data_totresources(i32 %0) {
%2 = tail call i64 @data_getresource(i32 %0, i32 0)
%3 = trunc i64 %2 to i32
%4 = tail call i64 @data_getresource(i32 %0, i32 1)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = tail call i64 @data_getresource(i32 %0, i32 2)
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
%10 = tail call i64 @data_getresource(i32 %0, i32 3)
%11 = trunc i64 %10 to i32
%12 = add i32 %9, %11
%13 = tail call i64 @data_getresource(i32 %0, i32 4)
%14 = trunc i64 %13 to i32
%15 = add i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ft_freer(void *to_del, int ret) {
  if (to_del)
    free(to_del);
  return (ret);
}


x86 assembly (clang, -O0):
<ft_freer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <ft_freer+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_freer>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
je     111d <ft_freer+0xd>
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_freer(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_freer(i8* %0, i32 returned %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret i32 %1
}
void foo301(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo301(i32 %0) {
ret void
}
void in_value(int set_at) {}


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

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

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

LLVM IR (-O2):
define void @in_value(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void pes_init(uint8_t *p_pes) {
  p_pes[0] = 0x0;
  p_pes[1] = 0x0;
  p_pes[2] = 0x1;
}


x86 assembly (clang, -O0):
<pes_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_init>:
movq   $0x0,(%rdi)
movl   $0x1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @pes_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1, i32* %8
ret void
}

LLVM IR (-O2):
define void @pes_init(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 1, i32* %3
ret void
}
int tup_drop_privs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tup_drop_privs() {
ret i32 0
}
/* Type definitions */
struct ufile {
  int dummy;
};
struct ft {
  int dummy;
};

/* Variables and functions */
struct ufile *ft_add_file(struct ft *, struct ufile *);
int /*<<< orphan*/ ufile_destroy(struct ufile *);
struct ufile *ufile_init(char const *);
struct ufile *ft_add_filepath(struct ft *ft, const char *fp) {
  struct ufile *f = ufile_init(fp);
  struct ufile *tmp = ft_add_file(ft, f);
  if (f != tmp)
    ufile_destroy(f);
  return tmp;
}


x86 assembly (clang, -O0):
<ft_add_filepath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ufile_init@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <ft_add_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1175 <ft_add_filepath+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <ufile_destroy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_add_filepath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <ufile_init@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <ft_add_file@plt>
mov    %rax,%r14
cmp    %rax,%rbx
je     115d <ft_add_filepath+0x2d>
mov    %rbx,%rdi
call   1030 <ufile_destroy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ufile = type { i32 }
%struct.ft = type { i32 }
define %struct.ufile* @ft_add_filepath(%struct.ft* %0, i8* %1) {
%3 = alloca %struct.ft*
%4 = alloca i8*
%5 = alloca %struct.ufile*
%6 = alloca %struct.ufile*
store %struct.ft* %0, %struct.ft** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call %struct.ufile* @ufile_init(i8* %7)
store %struct.ufile* %8, %struct.ufile** %5
%9 = load %struct.ft*, %struct.ft** %3
%10 = load %struct.ufile*, %struct.ufile** %5
%11 = call %struct.ufile* @ft_add_file(%struct.ft* %9, %struct.ufile* %10)
store %struct.ufile* %11, %struct.ufile** %6
%12 = load %struct.ufile*, %struct.ufile** %5
%13 = load %struct.ufile*, %struct.ufile** %6
%14 = icmp ne %struct.ufile* %12, %13
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load %struct.ufile*, %struct.ufile** %5
%17 = call i32 @ufile_destroy(%struct.ufile* %16)
br label %18
18: ; preds = %15, %2
%19 = load %struct.ufile*, %struct.ufile** %6
ret %struct.ufile* %19
}

LLVM IR (-O2):
%struct.ufile = type { i32 }
%struct.ft = type { i32 }
define %struct.ufile* @ft_add_filepath(%struct.ft* %0, i8* %1) {
%3 = tail call %struct.ufile* @ufile_init(i8* %1)
%4 = tail call %struct.ufile* @ft_add_file(%struct.ft* %0, %struct.ufile* %3)
%5 = icmp eq %struct.ufile* %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @ufile_destroy(%struct.ufile* %3)
br label %8
8: ; preds = %6, %2
ret %struct.ufile* %4
}
/* Variables and functions */
int arc4random_uniform(int);
int randint(int min, int max) {
  arc4random_uniform((max - min));
  arc4random_uniform((max - min));
  arc4random_uniform((max - min));
  return (arc4random_uniform((max - min) + 1) + min);
}


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

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
mov    %ebx,%edi
call   1030 <arc4random_uniform@plt>
mov    %ebx,%edi
call   1030 <arc4random_uniform@plt>
mov    %ebx,%edi
call   1030 <arc4random_uniform@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <arc4random_uniform@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = call i32 @arc4random_uniform(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = call i32 @arc4random_uniform(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = call i32 @arc4random_uniform(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
%20 = add nsw i32 %19, 1
%21 = call i32 @arc4random_uniform(i32 %20)
%22 = load i32, i32* %3
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @arc4random_uniform(i32 %3)
%5 = tail call i32 @arc4random_uniform(i32 %3)
%6 = tail call i32 @arc4random_uniform(i32 %3)
%7 = add nsw i32 %3, 1
%8 = tail call i32 @arc4random_uniform(i32 %7)
%9 = add nsw i32 %8, %0
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void test(void) {
  time_t new_time;
  new_time = time(&new_time);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
ret void
}
int bit_count(int num) {
  int result = 0;
  int mask = 1;
  while (mask != 0) {
    result += (mask & num) != 0 ? 1 : 0;
    mask <<= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<bit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <bit_count+0x46>
mov    -0xc(%rbp),%edx
and    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <bit_count+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_count>:
xor    %eax,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    (%rcx,%rcx,1),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    0x0(,%rcx,4),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    0x0(,%rcx,8),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
shl    $0x4,%ecx
jne    1110 <bit_count+0x10>
ret

LLVM IR (-O0):
define i32 @bit_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @bit_count(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %24, %2 ]
%4 = phi i32 [ 0, %1 ], [ %23, %2 ]
%5 = and i32 %3, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = shl i32 %3, 1
%10 = and i32 %9, %0
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = shl i32 %3, 2
%15 = and i32 %14, %0
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %13, %17
%19 = shl i32 %3, 3
%20 = and i32 %19, %0
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %18, %22
%24 = shl i32 %3, 4
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %2
26: ; preds = %2
ret i32 %23
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
unsigned int strtoul(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int sys_read_string(char *, char *, char *, int);
int sys_read_uint(char *dir_name, char *file_name, unsigned *u) {
  char buf[32];
  int r;
  if ((r = sys_read_string(dir_name, file_name, buf, sizeof(buf))) < 0)
    return r;
  *u = strtoul(buf, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<sys_read_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x20,%ecx
call   1040 <sys_read_string@plt>
mov    %eax,-0x44(%rbp)
cmp    $0x0,%eax
jge    1161 <sys_read_uint+0x41>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <sys_read_uint+0x5d>
lea    -0x40(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <strtoul@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_read_uint>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rsp,%rdx
mov    $0x20,%ecx
call   1040 <sys_read_string@plt>
test   %eax,%eax
js     114c <sys_read_uint+0x2c>
mov    %rsp,%rdi
xor    %ebp,%ebp
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,(%rbx)
jmp    114e <sys_read_uint+0x2e>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sys_read_uint(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca [32 x i8]
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%13 = call i32 @sys_read_string(i8* %10, i8* %11, i8* %12, i32 32)
store i32 %13, i32* %9
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %9
store i32 %16, i32* %4
br label %21
17: ; preds = %3
%18 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%19 = call i32 @strtoul(i8* %18, i32 0, i32 0)
%20 = load i32*, i32** %7
store i32 %19, i32* %20
store i32 0, i32* %4
br label %21
21: ; preds = %17, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @sys_read_uint(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = call i32 @sys_read_string(i8* %0, i8* %1, i8* %5, i32 32)
%7 = icmp slt i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @strtoul(i8* %5, i32 0, i32 0)
store i32 %9, i32* %2
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ 0, %8 ], [ %6, %3 ]
ret i32 %11
}
unsigned int GetTickCount() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GetTickCount() {
ret i32 0
}
void use(int n) { return; }


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

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

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

LLVM IR (-O2):
define void @use(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int A[], int length) {
  int index;
  for (index = 0; index < length; index++) {
    printf("%d ", A[index]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int fun194() { return 194; }


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

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

LLVM IR (-O0):
define i32 @fun194() {
ret i32 194
}

LLVM IR (-O2):
define i32 @fun194() {
ret i32 194
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_string(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                           char const *, char);
size_t coap_opt_put_location_query(uint8_t *buf, uint16_t lastonum,
                                   const char *location) {
  return coap_opt_put_string(buf, lastonum, (20), location, '&');
}


x86 assembly (clang, -O0):
<coap_opt_put_location_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x14,%edx
mov    $0x26,%r8d
call   1030 <coap_opt_put_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_opt_put_location_query>:
mov    %rdx,%rcx
mov    $0x14,%edx
mov    $0x26,%r8d
jmp    1030 <coap_opt_put_string@plt>

LLVM IR (-O0):
define i64 @coap_opt_put_location_query(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i64 @coap_opt_put_string(i32* %7, i32 %8, i32 20, i8* %9, i8 signext 38)
ret i64 %10
}

LLVM IR (-O2):
define i64 @coap_opt_put_location_query(i32* %0, i32 %1, i8* %2) {
%4 = tail call i64 @coap_opt_put_string(i32* %0, i32 %1, i32 20, i8* %2, i8 signext 38)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
char *strdup(int /*<<< orphan*/);
char *begin_posix_locale() {
  char *old_locale = NULL;
  old_locale = strdup(setlocale(LC_ALL, NULL));
  assert(old_locale != NULL);
  setlocale(LC_ALL, "POSIX");
  return old_locale;
}


x86 assembly (clang, -O0):
<begin_posix_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setlocale@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_posix_locale>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1040 <setlocale@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    (%r14),%edi
lea    0xe99(%rip),%rsi
call   1040 <setlocale@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [6 x i8] c"POSIX\00"
define i8* @begin_posix_locale() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* null)
%4 = call i8* @strdup(i32 %3)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* @LC_ALL
%10 = call i32 @setlocale(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [6 x i8] c"POSIX\00"
define i8* @begin_posix_locale() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* null)
%3 = tail call i8* @strdup(i32 %2)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* @LC_ALL
%8 = tail call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ListDirContentsAndSize(char *);
int /*<<< orphan*/ printf(char *);
void TestCase5(void) {
  printf(" ---- Test Case 5 ----\n");
  ListDirContentsAndSize("/home/user7");
}


x86 assembly (clang, -O0):
<TestCase5>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1040 <ListDirContentsAndSize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestCase5>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <ListDirContentsAndSize@plt>

LLVM IR (-O0):
@.str = [24 x i8] c" ---- Test Case 5 ----\0A\00"
@.str.1 = [12 x i8] c"/home/user7\00"
define void @TestCase5() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ListDirContentsAndSize(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"/home/user7\00"
@str = [23 x i8] c" ---- Test Case 5 ----\00"
define void @TestCase5() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @ListDirContentsAndSize(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
scalar_t__ stat(char *, struct stat *);
void svc_exec_service(char *exec_path, char **exec_params) {
  struct stat sexec = {0};
  struct pid_t;
  if (stat(exec_path, &sexec) == 0) {
    execv(exec_path, exec_params);
  }
}


x86 assembly (clang, -O0):
<svc_exec_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1174 <svc_exec_service+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svc_exec_service>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1149 <svc_exec_service+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <execv@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @svc_exec_service(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca %struct.stat
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = bitcast %struct.stat* %5 to i8*
%7 = load i8*, i8** %3
%8 = call i64 @stat(i8* %7, %struct.stat* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8**, i8*** %4
%13 = call i32 @execv(i8* %11, i8** %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @svc_exec_service(i8* %0, i8** %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
store i32 0, i32* %5
%6 = call i64 @stat(i8* %0, %struct.stat* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @execv(i8* %0, i8** %1)
br label %10
10: ; preds = %8, %2
ret void
}