xunge/DecIR huggingface dataset:
int isdigit(int c) { return ('0' <= c && c <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *minWindow(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *ab_a = minWindow("aA", "a");
  printf("everything is fine!\n");
  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)
lea    0xec3(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <minWindow@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"aA\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [21 x i8] c"everything is fine!\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* @minWindow(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"aA\00"
@.str.1 = [2 x i8] c"a\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @minWindow(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long long *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
long long get_mem_size(void) {
  FILE *fff;
  long long size;
  fff = popen("hinv -t memory", "r");
  fscanf(fff, "%*s%*s%*s %lld", &size);
  pclose(fff);
  return size;
}


x86 assembly (clang, -O0):
<get_mem_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pclose@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem_size>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <pclose@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hinv -t memory\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"%*s%*s%*s %lld\00"
define i64 @get_mem_size() {
%1 = alloca i32*
%2 = alloca i64
%3 = call i32* @popen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64* %2)
%6 = load i32*, i32** %1
%7 = call i32 @pclose(i32* %6)
%8 = load i64, i64* %2
ret i64 %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"hinv -t memory\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"%*s%*s%*s %lld\00"
define i64 @get_mem_size() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32* @popen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%5 = call i32 @pclose(i32* %3)
%6 = load i64, i64* %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void finish_b2(void) { printf("finish_b2\n"); }


x86 assembly (clang, -O0):
<finish_b2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"finish_b2\0A\00"
define void @finish_b2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"finish_b2\00"
define void @finish_b2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "\033[H\033[2J");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void union_set_io(char *args) {}


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

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

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

LLVM IR (-O2):
define void @union_set_io(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printNumber(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                               unsigned char);
void printX(unsigned char chr) { printNumber(16, 2, 0, '0', chr); }


x86 assembly (clang, -O0):
<printX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x10,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x30,%ecx
movzbl -0x1(%rbp),%r8d
call   1030 <printNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printX>:
mov    %edi,%r8d
mov    $0x10,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x30,%ecx
jmp    1030 <printNumber@plt>

LLVM IR (-O0):
define void @printX(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printNumber(i32 16, i32 2, i32 0, i32 48, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @printX(i8 zeroext %0) {
%2 = tail call i32 @printNumber(i32 16, i32 2, i32 0, i32 48, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  int *pI = (int *)malloc(sizeof(int));
  *pI = 2;
  free(pI);
  printf("Now freeing a pointer twice...\n");
  free(pI);
  printf("Did you notice?\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x2,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [32 x i8] c"Now freeing a pointer twice...\0A\00"
@.str.2 = [17 x i8] c"Did you notice?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 2, i32* %6
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
@str.3 = [31 x i8] c"Now freeing a pointer twice...\00"
@str.4 = [16 x i8] c"Did you notice?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 2, i32* %3
%4 = tail call i32 @free(i32* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @free(i32* %3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *bc_malloc(size_t size) {
  void *rv = malloc(size);
  if (rv == NULL) {
    fprintf(stderr, "fatal: Failed to allocate memory!\n");
    abort();
  }
  return rv;
}


x86 assembly (clang, -O0):
<bc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <bc_malloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_malloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <bc_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"fatal: Failed to allocate memory!\0A\00"
define i8* @bc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"fatal: Failed to allocate memory!\0A\00"
define noalias i8* @bc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_something_during_teardown() {
  printf("\tI was called during teardown\n");
}


x86 assembly (clang, -O0):
<print_something_during_teardown>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"\09I was called during teardown\0A\00"
define void @print_something_during_teardown() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\09I was called during teardown\00"
define void @print_something_during_teardown() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x84() {
  Assert_real((isalpha(132) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              665, ("isalpha should be 0 for 0x84"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x84>:
push   %rax
mov    $0x84,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x299,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x84\00"
define void @t_isalpha_0x84() {
%1 = call i64 @isalpha(i32 132)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 665, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x84\00"
define void @t_isalpha_0x84() {
%1 = tail call i64 @isalpha(i32 132)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 665, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ msg(int, char *, int /*<<< orphan*/);
char *strdup(char const *);
int /*<<< orphan*/ strlen(char const *);
char *xstrdup(const char *s) {
  char *result = strdup(s);
  if (!result) {
    msg(-3, "Failed to strdup %zi bytes\n", strlen(s));
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118e <xstrdup+0x4e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    $0xfffffffd,%edi
lea    0xe85(%rip),%rsi
call   1060 <msg@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strdup@plt>
test   %rax,%rax
je     1150 <xstrdup+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rsi
mov    $0xfffffffd,%edi
mov    %eax,%edx
call   1060 <msg@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to strdup %zi bytes\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @msg(i32 -3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to strdup %zi bytes\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @msg(i32 -3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int unaligned32(void const *);
int unaligned32_le(const void *v) { return (unaligned32(v)); }


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

x86 assembly (clang, -O2):
<unaligned32_le>:
jmp    1030 <unaligned32@plt>

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

LLVM IR (-O2):
define i32 @unaligned32_le(i8* %0) {
%2 = tail call i32 @unaligned32(i8* %0)
ret i32 %2
}
int absInteger(int a) {
  if (a < 0) {
    return (-a);
  }
  return a;
}


x86 assembly (clang, -O0):
<absInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <absInteger+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absInteger+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absInteger>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absInteger(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @absInteger(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(int);
int main(void) {
  if (foo(-1) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     114a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <foo@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 -1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 -1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int test_imm_A8uint8_reg(unsigned char val) {
  return ((val) & (-0xA8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff58,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A8uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -168
%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_A8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 88
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void a_barrier() { __sh_cas(&(int){0}, 0, 0); }


x86 assembly (clang, -O0):
<a_barrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <__sh_cas@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_barrier>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <__sh_cas@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @a_barrier() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @__sh_cas to i32 (i32*, i32, i32, ...)*)(i32* %1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @a_barrier() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @__sh_cas to i32 (i32*, i32, i32, ...)*)(i32* %1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doentexp(int /*<<< orphan*/, int /*<<< orphan*/);
void pexport(void) { doentexp(0, 0); }


x86 assembly (clang, -O0):
<pexport>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <doentexp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pexport>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <doentexp@plt>

LLVM IR (-O0):
define void @pexport() {
%1 = call i32 @doentexp(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @pexport() {
%1 = tail call i32 @doentexp(i32 0, i32 0)
ret void
}
void __udelay(unsigned us) {
  volatile unsigned int i;
  for (i = 0; i < us * 3; i++)
    ;
}


x86 assembly (clang, -O0):
<__udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x3,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jae    1130 <__udelay+0x30>
jmp    1122 <__udelay+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <__udelay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__udelay>:
movl   $0x0,-0x4(%rsp)
lea    (%rdi,%rdi,2),%eax
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%ecx
cmp    %eax,%ecx
jae    111f <__udelay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <__udelay+0x10>
ret

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

LLVM IR (-O2):
define void @__udelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = mul i32 %0, 3
%5 = load volatile i32, i32* %2
%6 = icmp ult i32 %5, %4
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = load volatile i32, i32* %2
%9 = add i32 %8, 1
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = icmp ult i32 %10, %4
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret void
}
int *geta() {
  auto int a = 100;
  return &a;
}


x86 assembly (clang, -O0):
<geta>:
push   %rbp
mov    %rsp,%rbp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geta>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @geta() {
%1 = alloca i32
store i32 100, i32* %1
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @geta() {
%1 = alloca i32
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ __exit(int);
int /*<<< orphan*/ __getpid();
int /*<<< orphan*/ __kill(int /*<<< orphan*/, int, int /*<<< orphan*/);
void __attribute__((noreturn)) abort(void) {
  (void)__kill(__getpid(), 6, 0);
  __exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__getpid@plt>
mov    %eax,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1050 <__kill@plt>
mov    $0x1,%edi
call   1030 <__exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1040 <__getpid@plt>
mov    %eax,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1050 <__kill@plt>
mov    $0x1,%edi
call   1030 <__exit@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 (...) @__getpid()
%2 = call i32 @__kill(i32 %1, i32 6, i32 0)
%3 = call i32 @__exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 (...) @__getpid()
%2 = tail call i32 @__kill(i32 %1, i32 6, i32 0)
%3 = tail call i32 @__exit(i32 1)
unreachable
}
/* Variables and functions */
bool is_array(const char *name) { return *name == '['; }


x86 assembly (clang, -O0):
<is_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_array>:
xor    %eax,%eax
cmpb   $0x5b,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_array(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 91
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_array(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 91
%4 = zext i1 %3 to i32
ret i32 %4
}
void modulo_signed_neg_Bad(int i) {
  char arr[5];
  arr[i % -5] = 123;
}


x86 assembly (clang, -O0):
<modulo_signed_neg_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffffb,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movb   $0x7b,-0x9(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_signed_neg_Bad(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, -5
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %6
store i8 123, i8* %7
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ write_byte_data(int /*<<< orphan*/, int, int);
void set_all_pwm(uint16_t on, uint16_t off, uint8_t address) {
  write_byte_data(address, 0xFA, on & 0xFF);
  write_byte_data(address, 0xFB, on >> 8);
  write_byte_data(address, 0xFC, off & 0xFF);
  write_byte_data(address, 0xFD, off >> 8);
}


x86 assembly (clang, -O0):
<set_all_pwm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    $0xfa,%esi
call   1030 <write_byte_data@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%edx
sar    $0x8,%edx
mov    $0xfb,%esi
call   1030 <write_byte_data@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    $0xfc,%esi
call   1030 <write_byte_data@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
sar    $0x8,%edx
mov    $0xfd,%esi
call   1030 <write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_all_pwm>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %edi,%ebx
movzbl %bl,%edx
mov    %ebp,%edi
mov    $0xfa,%esi
call   1030 <write_byte_data@plt>
sar    $0x8,%ebx
mov    %ebp,%edi
mov    $0xfb,%esi
mov    %ebx,%edx
call   1030 <write_byte_data@plt>
movzbl %r14b,%edx
mov    %ebp,%edi
mov    $0xfc,%esi
call   1030 <write_byte_data@plt>
sar    $0x8,%r14d
mov    %ebp,%edi
mov    $0xfd,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write_byte_data@plt>

LLVM IR (-O0):
define void @set_all_pwm(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = call i32 @write_byte_data(i32 %7, i32 250, i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = call i32 @write_byte_data(i32 %11, i32 251, i32 %13)
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = and i32 %16, 255
%18 = call i32 @write_byte_data(i32 %15, i32 252, i32 %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = ashr i32 %20, 8
%22 = call i32 @write_byte_data(i32 %19, i32 253, i32 %21)
ret void
}

LLVM IR (-O2):
define void @set_all_pwm(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 255
%5 = tail call i32 @write_byte_data(i32 %2, i32 250, i32 %4)
%6 = ashr i32 %0, 8
%7 = tail call i32 @write_byte_data(i32 %2, i32 251, i32 %6)
%8 = and i32 %1, 255
%9 = tail call i32 @write_byte_data(i32 %2, i32 252, i32 %8)
%10 = ashr i32 %1, 8
%11 = tail call i32 @write_byte_data(i32 %2, i32 253, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FTM2_DriverIRQHandler();
__attribute__((weak)) void FTM2_IRQHandler(void) { FTM2_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @FTM2_IRQHandler() {
%1 = call i32 (...) @FTM2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @FTM2_IRQHandler() {
%1 = tail call i32 (...) @FTM2_DriverIRQHandler()
ret void
}
/* Variables and functions */
void baz(int c[foo()]) { return; }


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

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

LLVM IR (-O0):
define void @baz(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @foo()
%4 = zext i32 %3 to i64
ret void
}

LLVM IR (-O2):
define void @baz(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char string[20];
  int number;
  scanf("%[^\t\n]s", &string);
  printf("string is %s\n", string);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%[^\09\0A]s\00"
@.str.1 = [14 x i8] c"string is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%[^\09\0A]s\00"
@.str.1 = [14 x i8] c"string is %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = bitcast [20 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void ab8500_fg_reinit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ab8500_fg_reinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void CTA_Free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<CTA_Free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @CTA_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_h12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h12_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void Mat_Help(const char *helpstr[]) {
  int i;
  for (i = 0; helpstr[i] != NULL; i++)
    printf("%s\n", helpstr[i]);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<Mat_Help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116c <Mat_Help+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Mat_Help+0x13>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Mat_Help>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1154 <Mat_Help+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <Mat_Help+0x20>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define void @Mat_Help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 88;
  printf("I am %d years old \n", age);
  printf("I am %d inches tall", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x58,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x58,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old \0A\00"
@.str.1 = [20 x i8] c"I am %d inches tall\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 88, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old \0A\00"
@.str.1 = [20 x i8] c"I am %d inches tall\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 88)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void execvp_noret(char **argv) {
  execvp(*argv, argv);
  perror(*argv);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<execvp_noret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <execvp@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<execvp_noret>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rbx,%rsi
call   1040 <execvp@plt>
mov    (%rbx),%rdi
call   1030 <perror@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @execvp_noret(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = call i32 @execvp(i8* %4, i8** %5)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = call i32 @perror(i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @execvp_noret(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = load i8*, i8** %0
%5 = tail call i32 @perror(i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int strlen(char *s) {
  unsigned int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
float ftcController(float input) {
  if (input < 0)
    return input / 128;
  else
    return input / 127;
}


x86 assembly (clang, -O0):
<ftcController>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1131 <ftcController+0x31>
movss  -0x8(%rbp),%xmm0
movss  0xee1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1147 <ftcController+0x47>
movss  -0x8(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftcController>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1111 <ftcController+0x11>
mulss  0xef4(%rip),%xmm0
ret
divss  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ftcController(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fdiv float %7, 1.280000e+02
store float %8, float* %2
br label %12
9: ; preds = %1
%10 = load float, float* %3
%11 = fdiv float %10, 1.270000e+02
store float %11, float* %2
br label %12
12: ; preds = %9, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @ftcController(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fmul float %0, 7.812500e-03
br label %7
5: ; preds = %1
%6 = fdiv float %0, 1.270000e+02
br label %7
7: ; preds = %5, %3
%8 = phi float [ %4, %3 ], [ %6, %5 ]
ret float %8
}
unsigned grid2x_generic_input_fmts(void) { return (1 << 1) | (1 << 0); }


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

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

LLVM IR (-O0):
define i32 @grid2x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @grid2x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
scalar_t__ fossil_islower(char);
int fossil_toupper(char c) { return fossil_islower(c) ? c - 'a' + 'A' : c; }


x86 assembly (clang, -O0):
<fossil_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <fossil_islower@plt>
cmp    $0x0,%rax
je     1143 <fossil_toupper+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <fossil_toupper+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <fossil_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fossil_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @fossil_islower(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 65
br label %14
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
br label %14
14: ; preds = %11, %6
%15 = phi i32 [ %10, %6 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @fossil_toupper(i8 signext %0) {
%2 = tail call i64 @fossil_islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -32
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void cmp_al_imm8(unsigned char imm8) {
  put8(0x3C);
  put8(imm8);
}


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

x86 assembly (clang, -O2):
<cmp_al_imm8>:
push   %rbx
mov    %edi,%ebx
mov    $0x3c,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_al_imm8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 60)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @cmp_al_imm8(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 60)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
/* Variables and functions */
unsigned long find(unsigned long);
long peek(unsigned long);
long is_legal(unsigned long newjob) {
  unsigned long parent;
  long hidden;
  parent = find(newjob);
  hidden = peek(parent);
  if (hidden == -1)
    return -1;
  else
    return hidden;
}


x86 assembly (clang, -O0):
<is_legal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <find@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <peek@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    115e <is_legal+0x3e>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1166 <is_legal+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_legal>:
push   %rax
call   1040 <find@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <peek@plt>

LLVM IR (-O0):
define i64 @is_legal(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = call i64 @find(i64 %6)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 @peek(i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = icmp eq i64 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i64 -1, i64* %2
br label %15
13: ; preds = %1
%14 = load i64, i64* %5
store i64 %14, i64* %2
br label %15
15: ; preds = %13, %12
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @is_legal(i64 %0) {
%2 = tail call i64 @find(i64 %0)
%3 = tail call i64 @peek(i64 %2)
ret i64 %3
}